2018-01-11 12:50:40 -06:00
|
|
|
#![feature(generators)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|| {
|
|
|
|
// The reference in `_a` is a Legal with NLL since it ends before the yield
|
2018-07-26 06:17:33 -05:00
|
|
|
let _a = &mut true;
|
|
|
|
let b = &mut true;
|
|
|
|
//~^ borrow may still be in use when generator yields
|
2018-01-11 12:50:40 -06:00
|
|
|
yield ();
|
|
|
|
println!("{}", b);
|
|
|
|
};
|
|
|
|
}
|