]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-21600.nll.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-21600.nll.stderr
1 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
2   --> $DIR/issue-21600.rs:24:20
3    |
4 LL |         call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer
5    |                    ^ cannot borrow as mutable
6    |
7 help: consider changing this to accept closures that implement `FnMut`
8   --> $DIR/issue-21600.rs:24:17
9    |
10 LL |         call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer
11    |                 ^^^^^^^^^^^^^^
12
13 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
14   --> $DIR/issue-21600.rs:24:17
15    |
16 LL |         call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer
17    |                 ^^ - mutable borrow occurs due to use of `x` in closure
18    |                 |
19    |                 cannot borrow as mutable
20    |
21 help: consider changing this to accept closures that implement `FnMut`
22   --> $DIR/issue-21600.rs:22:13
23    |
24 LL |       call_it(|| {
25    |  _____________^
26 LL | |         call_it(|| x.gen());
27 LL | |         call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer
28 LL | |         //~^ ERROR cannot borrow data mutably in a captured outer
29 LL | |     });
30    | |_____^
31
32 error: aborting due to 2 previous errors
33
34 For more information about this error, try `rustc --explain E0596`.