2023-10-19 21:46:28 +00:00
|
|
|
#![feature(coroutines)]
|
2018-01-11 19:50:40 +01:00
|
|
|
|
|
|
|
fn main() {
|
2024-04-11 13:15:34 +00:00
|
|
|
#[coroutine]
|
2018-01-11 19:50:40 +01:00
|
|
|
|| {
|
|
|
|
// The reference in `_a` is a Legal with NLL since it ends before the yield
|
2018-07-26 13:17:33 +02:00
|
|
|
let _a = &mut true;
|
|
|
|
let b = &mut true;
|
2023-10-19 21:46:28 +00:00
|
|
|
//~^ borrow may still be in use when coroutine yields
|
2018-01-11 19:50:40 +01:00
|
|
|
yield ();
|
|
|
|
println!("{}", b);
|
|
|
|
};
|
|
|
|
}
|