]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-21600.stderr
Update unsuspicious file list
[rustc.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 | fn call_it<F>(f: F) where F: Fn() { f(); }
5 | - change this to accept `FnMut` instead of `Fn`
6 ...
7 LL | call_it(|| x.gen_mut());
8 | ------- -- ^^^^^^^^^^^ cannot borrow as mutable
9 | | |
10 | | in this closure
11 | expects `Fn` instead of `FnMut`
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 | fn call_it<F>(f: F) where F: Fn() { f(); }
17 | - change this to accept `FnMut` instead of `Fn`
18 ...
19 LL | call_it(|| {
20 | ------- -- in this closure
21 | |
22 | expects `Fn` instead of `FnMut`
23 LL | call_it(|| x.gen());
24 LL | call_it(|| x.gen_mut());
25 | ^^ - mutable borrow occurs due to use of `x` in closure
26 | |
27 | cannot borrow as mutable
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0596`.