summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/issues/issue-51719.rs
blob: 09241f982aa8a6685e7bf31e4b5acb5d615a87be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// edition:2018
//
// Tests that the .await syntax can't be used to make a generator

async fn foo() {}

fn make_generator() {
    let _gen = || foo().await;
    //~^ ERROR `await` is only allowed inside `async` functions and blocks
}

fn main() {}