]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-62009-1.rs
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / issue-62009-1.rs
1 // edition:2018
2
3 async fn print_dur() {}
4
5 fn main() {
6     async { let (); }.await;
7     //~^ ERROR `await` is only allowed inside `async` functions and blocks
8     async {
9         let task1 = print_dur().await;
10     }.await;
11     //~^ ERROR `await` is only allowed inside `async` functions and blocks
12     (|_| 2333).await;
13     //~^ ERROR `await` is only allowed inside `async` functions and blocks
14     //~| ERROR is not a future
15 }