]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/non-async-enclosing-span.rs
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / non-async-enclosing-span.rs
1 // edition:2018
2
3 async fn do_the_thing() -> u8 {
4     8
5 }
6 // #63398: point at the enclosing scope and not the previously seen closure
7 fn main() {  //~ NOTE this is not `async`
8     let x = move || {};
9     let y = do_the_thing().await; //~ ERROR `await` is only allowed inside `async` functions
10     //~^ NOTE only allowed inside `async` functions and blocks
11 }