2019-04-18 12:55:23 -07:00
|
|
|
// edition:2018
|
|
|
|
//
|
2023-10-19 21:46:28 +00:00
|
|
|
// Tests that the .await syntax can't be used to make a coroutine
|
2019-04-18 12:55:23 -07:00
|
|
|
|
|
|
|
async fn foo() {}
|
|
|
|
|
2023-10-19 21:46:28 +00:00
|
|
|
fn make_coroutine() {
|
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() {}
|