Closed
Description
When compiling:
#![feature(generators)]
fn main() {
let _a = || {
if false { yield }
let a = String::new();
a.len()
};
}
I currently get:
error[E0597]: `a` does not live long enough
--> foo.rs:8:5
|
7 | a.len()
| - borrow occurs here
8 | };
| ^ `a` dropped here while still borrowed
9 | }
| - borrowed value needs to live until here
error: aborting due to previous error
Would be nice to not have to bind it to a local!