summaryrefslogtreecommitdiffstats
path: root/src/test/ui/async-await/issues/non-async-enclosing-span.rs
blob: d47c2137725d61f6b9780ce57248de31e4be8e80 (plain)
1
2
3
4
5
6
7
8
9
10
11
// edition:2018

async fn do_the_thing() -> u8 {
    8
}
// #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
    //~^ NOTE only allowed inside `async` functions and blocks
}