rust/src/test/ui/async-await/issues/issue-51719.rs

14 lines
268 B
Rust
Raw Normal View History

// edition:2018
//
// Tests that the .await syntax can't be used to make a generator
#![feature(async_await)]
async fn foo() {}
fn make_generator() {
let _gen = || foo.await; //~ ERROR `await` is only allowed inside `async` functions and blocks
}
2019-05-16 03:37:50 +00:00
fn main() {}