2019-04-18 14:55:23 -05:00
|
|
|
//@ edition:2018
|
|
|
|
//
|
2023-10-19 16:46:28 -05:00
|
|
|
// Tests that the .await syntax can't be used to make a coroutine
|
2019-04-18 14:55:23 -05:00
|
|
|
|
|
|
|
async fn foo() {}
|
|
|
|
|
2023-10-19 16:46:28 -05:00
|
|
|
fn make_coroutine() {
|
2019-06-26 07:48:41 -05:00
|
|
|
let _gen = || foo().await;
|
|
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
2019-04-18 14:55:23 -05:00
|
|
|
}
|
2019-05-15 21:47:18 -05:00
|
|
|
|
2019-05-15 22:37:50 -05:00
|
|
|
fn main() {}
|