mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
16 lines
427 B
Rust
16 lines
427 B
Rust
// edition:2018
|
|
|
|
async fn print_dur() {}
|
|
|
|
fn main() {
|
|
async { let (); }.await;
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
|
async {
|
|
let task1 = print_dur().await;
|
|
}.await;
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
|
(|_| 2333).await;
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
|
//~| ERROR is not a future
|
|
}
|