summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/issues/issue-61986.rs
blob: 879bc6912fce94364d890d85a190d41cd947b2eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// build-pass (FIXME(62277): could be check-pass?)
// edition:2018
//
// Tests that we properly handle StorageDead/StorageLives for temporaries
// created in async loop bodies.

async fn bar() -> Option<()> {
    Some(())
}

async fn listen() {
    while let Some(_) = bar().await {
        String::new();
    }
}

fn main() {
    listen();
}