2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2019-06-26 12:23:27 -05:00
|
|
|
// 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();
|
|
|
|
}
|