Skip to content

Commit

Permalink
Rollup merge of rust-lang#62155 - cramertj:61872, r=centril
Browse files Browse the repository at this point in the history
Add regression test for MIR drop generation in async loops

Fixes rust-lang#61986.

r? @Centril
  • Loading branch information
Centril committed Jun 27, 2019
2 parents b732955 + 72ca844 commit 12f86c3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/async-await/issues/issue-61986.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// compile-pass
// edition:2018
//
// Tests that we properly handle StorageDead/StorageLives for temporaries
// created in async loop bodies.

#![feature(async_await)]

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

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

fn main() {
listen();
}

0 comments on commit 12f86c3

Please sign in to comment.