2019-06-26 13:48:41 +01:00
|
|
|
// 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;
|
2021-11-16 00:57:53 +00:00
|
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
2019-06-26 13:48:41 +01:00
|
|
|
(|_| 2333).await;
|
|
|
|
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
2021-11-16 00:57:53 +00:00
|
|
|
//~| ERROR is not a future
|
2019-06-26 13:48:41 +01:00
|
|
|
}
|