]> git.proxmox.com Git - rustc.git/blame - src/test/ui/async-await/issues/issue-69307.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / async-await / issues / issue-69307.rs
CommitLineData
ba9703b0
XL
1// Regression test for #69307
2//
94222f64 3// Having an `async { .. foo.await .. }` block appear inside of a `+=`
ba9703b0
XL
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
10fn block_on<F>(_: F) -> usize {
11 0
12}
13
14fn main() {}
15
16async fn bar() {
17 let mut sum = 0;
18 sum += block_on(async {
19 baz().await;
20 });
21}
22
23async fn baz() {}