rust/tests/ui/async-await/issues/non-async-enclosing-span.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
357 B
Rust
Raw Normal View History

// edition:2018
async fn do_the_thing() -> u8 {
8
}
2019-08-13 13:27:00 -05:00
// #63398: point at the enclosing scope and not the previously seen closure
fn main() { //~ NOTE this is not `async`
let x = move || {};
let y = do_the_thing().await; //~ ERROR `await` is only allowed inside `async` functions
2019-08-13 13:27:00 -05:00
//~^ NOTE only allowed inside `async` functions and blocks
}