2019-04-18 12:55:23 -07:00
|
|
|
// edition:2018
|
|
|
|
|
//
|
|
|
|
|
// Tests that the .await syntax can't be used to make a generator
|
|
|
|
|
|
|
|
|
|
async fn foo() {}
|
|
|
|
|
|
|
|
|
|
fn make_generator() {
|
2019-06-26 13:48:41 +01:00
|
|
|
let _gen = || foo().await;
|
|
|
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
2019-04-18 12:55:23 -07:00
|
|
|
}
|
2019-05-15 19:47:18 -07:00
|
|
|
|
2019-05-15 20:37:50 -07:00
|
|
|
fn main() {}
|