mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
13 lines
250 B
Rust
13 lines
250 B
Rust
//@ edition:2018
|
|
//
|
|
// Tests that the .await syntax can't be used to make a coroutine
|
|
|
|
async fn foo() {}
|
|
|
|
fn make_coroutine() {
|
|
let _gen = || foo().await;
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
|
}
|
|
|
|
fn main() {}
|