Skip to content

Commit cd9f709

Browse files
committed
add nested regression test
1 parent e7f8895 commit cd9f709

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 += {
19+
block_on(async {
20+
baz().await;
21+
let mut inner = 1;
22+
inner += block_on(async {
23+
baz().await;
24+
0
25+
})
26+
})
27+
};
28+
}
29+
30+
async fn baz() {}

0 commit comments

Comments
 (0)