]> git.proxmox.com Git - rustc.git/blob - tests/ui/async-await/issues/issue-61986.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / async-await / issues / issue-61986.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2 // edition:2018
3 //
4 // Tests that we properly handle StorageDead/StorageLives for temporaries
5 // created in async loop bodies.
6
7 async fn bar() -> Option<()> {
8 Some(())
9 }
10
11 async fn listen() {
12 while let Some(_) = bar().await {
13 String::new();
14 }
15 }
16
17 fn main() {
18 listen();
19 }