]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/yield-while-ref-reborrowed.stderr
Fix UI test
[rust.git] / src / test / ui / generator / yield-while-ref-reborrowed.stderr
1 error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
2   --> $DIR/yield-while-ref-reborrowed.rs:45:20
3    |
4 40 |     let mut b = || {
5    |                 -- closure construction occurs here
6 41 |         let a = &mut *x;
7    |                       - previous borrow occurs due to use of `x` in closure
8 ...
9 45 |     println!("{}", x); //~ ERROR
10    |                    ^ borrow occurs here
11 46 |     b.resume();
12 47 | }
13    | - borrow from closure ends here
14
15 error: aborting due to previous error
16