about summary refs log tree commit diff
path: root/tests/ui/coroutine/coroutine-with-nll.rs
blob: 44ead560cf889525a474e16ca0222ac90e5681dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![feature(coroutines)]

fn main() {
    #[coroutine]
    || {
        // The reference in `_a` is a Legal with NLL since it ends before the yield
        let _a = &mut true;
        let b = &mut true;
        //~^ ERROR borrow may still be in use when coroutine yields
        yield ();
        println!("{}", b);
    };
}