]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / unboxed-closures / unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr
1 error[E0596]: cannot borrow `tick1` as mutable, as it is not declared as mutable
2   --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:16:9
3    |
4 LL |     let tick1 = || {
5    |         ----- help: consider changing this to be mutable: `mut tick1`
6 LL |         counter += 1;
7    |         ------- calling `tick1` requires mutable binding due to mutable borrow of `counter`
8 ...
9 LL |         tick1();
10    |         ^^^^^ cannot borrow as mutable
11
12 error[E0596]: cannot borrow `tick2` as mutable, as it is not declared as mutable
13   --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:19:5
14    |
15 LL |         tick1();
16    |         ----- calling `tick2` requires mutable binding due to mutable borrow of `tick1`
17 ...
18 LL |     tick2();
19    |     ^^^^^ cannot borrow as mutable
20    |
21 help: consider changing this to be mutable
22    |
23 LL |     let mut tick2 = || {
24    |         +++
25
26 error: aborting due to 2 previous errors
27
28 For more information about this error, try `rustc --explain E0596`.