]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / 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 |     let tick2 = || {
16    |         ----- help: consider changing this to be mutable: `mut tick2`
17 LL |         tick1();
18    |         ----- calling `tick2` requires mutable binding due to mutable borrow of `tick1`
19 ...
20 LL |     tick2();
21    |     ^^^^^ cannot borrow as mutable
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0596`.