rust/tests/ui/async-await/issues/issue-62009-1.rs
2024-02-16 20:02:50 +00:00

15 lines
397 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
}