mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
20 lines
345 B
Rust
20 lines
345 B
Rust
//@ 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();
|
|
}
|