]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-69307.rs
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / issue-69307.rs
1 // Regression test for #69307
2 //
3 // Having a `async { .. foo.await .. }` block appear inside of a `+=`
4 // expression was causing an ICE due to a failure to save/restore
5 // state in the AST numbering pass when entering a nested body.
6 //
7 // check-pass
8 // edition:2018
9
10 fn block_on<F>(_: F) -> usize {
11     0
12 }
13
14 fn main() {}
15
16 async fn bar() {
17     let mut sum = 0;
18     sum += block_on(async {
19         baz().await;
20     });
21 }
22
23 async fn baz() {}