1
Fork 0
rust/tests/ui/coroutine/coroutine-with-nll.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
301 B
Rust
Raw Normal View History

2023-10-19 21:46:28 +00:00
#![feature(coroutines)]
fn main() {
|| {
// The reference in `_a` is a Legal with NLL since it ends before the yield
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
yield ();
println!("{}", b);
};
}