about summary refs log tree commit diff
path: root/tests/ui/async-await/issues/issue-62009-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/issues/issue-62009-1.rs')
-rw-r--r--tests/ui/async-await/issues/issue-62009-1.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/async-await/issues/issue-62009-1.rs b/tests/ui/async-await/issues/issue-62009-1.rs
new file mode 100644
index 00000000000..40ccf25712e
--- /dev/null
+++ b/tests/ui/async-await/issues/issue-62009-1.rs
@@ -0,0 +1,15 @@
+// edition:2018
+
+async fn print_dur() {}
+
+fn main() {
+    async { let (); }.await;
+    //~^ ERROR `await` is only allowed inside `async` functions and blocks
+    async {
+        let task1 = print_dur().await;
+    }.await;
+    //~^ ERROR `await` is only allowed inside `async` functions and blocks
+    (|_| 2333).await;
+    //~^ ERROR `await` is only allowed inside `async` functions and blocks
+    //~| ERROR is not a future
+}