]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-51719.rs
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / issue-51719.rs
1 // edition:2018
2 //
3 // Tests that the .await syntax can't be used to make a generator
4
5 async fn foo() {}
6
7 fn make_generator() {
8     let _gen = || foo().await;
9     //~^ ERROR `await` is only allowed inside `async` functions and blocks
10 }
11
12 fn main() {}