]> git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/issues/issue-62009.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / ui / async-await / issues / issue-62009.rs
1 // edition:2018
2
3 #![feature(async_await)]
4
5 async fn print_dur() {}
6
7 fn main() {
8 async { let (); }.await;
9 //~^ ERROR `await` is only allowed inside `async` functions and blocks
10 async {
11 //~^ ERROR `await` is only allowed inside `async` functions and blocks
12 let task1 = print_dur().await;
13 }.await;
14 (async || 2333)().await;
15 //~^ ERROR `await` is only allowed inside `async` functions and blocks
16 (|_| 2333).await;
17 //~^ ERROR `await` is only allowed inside `async` functions and blocks
18 //~^^ ERROR
19 }