summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/issues/issue-62009-1.rs
blob: 51d216408d7ee0cbc410b3c2a9ab011403cfe335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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
}