Rollup merge of #62155 - cramertj:61872, r=centril
Add regression test for MIR drop generation in async loops Fixes #61986. r? @Centril
This commit is contained in:
commit
a1a0e0c945
21
src/test/ui/async-await/issues/issue-61986.rs
Normal file
21
src/test/ui/async-await/issues/issue-61986.rs
Normal file
@ -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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user