summaryrefslogtreecommitdiffstats
path: root/tests/ui/fn/suggest-return-future.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/fn/suggest-return-future.rs')
-rw-r--r--tests/ui/fn/suggest-return-future.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/fn/suggest-return-future.rs b/tests/ui/fn/suggest-return-future.rs
new file mode 100644
index 000000000..750740d94
--- /dev/null
+++ b/tests/ui/fn/suggest-return-future.rs
@@ -0,0 +1,23 @@
+// edition: 2021
+
+async fn a() -> i32 {
+ 0
+}
+
+fn foo() -> _ {
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types [E0121]
+ //~| NOTE not allowed in type signatures
+ //~| HELP replace with an appropriate return type
+ //~| SUGGESTION impl Future<Output = i32>
+ a()
+}
+
+fn bar() -> _ {
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types [E0121]
+ //~| NOTE not allowed in type signatures
+ //~| HELP replace with an appropriate return type
+ //~| SUGGESTION impl Future<Output = i32>
+ async { a().await }
+}
+
+fn main() {}