rust/tests/ui/async-await/issues/issue-51719.rs
2023-01-11 09:32:08 +00:00

13 lines
249 B
Rust

// 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() {}