]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-21600.stderr
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-21600.stderr
1 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
2   --> $DIR/issue-21600.rs:14:20
3    |
4 LL |         call_it(|| x.gen_mut());
5    |                    ^ cannot borrow as mutable
6    |
7 help: consider changing this to accept closures that implement `FnMut`
8   --> $DIR/issue-21600.rs:14:17
9    |
10 LL |         call_it(|| x.gen_mut());
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:14:17
15    |
16 LL |         call_it(|| x.gen_mut());
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:12:13
23    |
24 LL |       call_it(|| {
25    |  _____________^
26 LL | |         call_it(|| x.gen());
27 LL | |         call_it(|| x.gen_mut());
28 LL | |
29 LL | |
30 LL | |     });
31    | |_____^
32
33 error: aborting due to 2 previous errors
34
35 For more information about this error, try `rustc --explain E0596`.