]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-argument.stderr
Rollup merge of #102245 - ink-feather-org:const_cmp_by, r=fee1-dead
[rust.git] / src / test / ui / borrowck / borrowck-argument.stderr
1 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
2   --> $DIR/borrowck-argument.rs:10:5
3    |
4 LL | fn func(arg: S) {
5    |         --- help: consider changing this to be mutable: `mut arg`
6 LL |     arg.mutate();
7    |     ^^^^^^^^^^^^ cannot borrow as mutable
8
9 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
10   --> $DIR/borrowck-argument.rs:15:9
11    |
12 LL |     fn method(&self, arg: S) {
13    |                      --- help: consider changing this to be mutable: `mut arg`
14 LL |         arg.mutate();
15    |         ^^^^^^^^^^^^ cannot borrow as mutable
16
17 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
18   --> $DIR/borrowck-argument.rs:21:9
19    |
20 LL |     fn default(&self, arg: S) {
21    |                       --- help: consider changing this to be mutable: `mut arg`
22 LL |         arg.mutate();
23    |         ^^^^^^^^^^^^ cannot borrow as mutable
24
25 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
26   --> $DIR/borrowck-argument.rs:32:17
27    |
28 LL |     (|arg: S| { arg.mutate() })(s);
29    |       ---       ^^^^^^^^^^^^ cannot borrow as mutable
30    |       |
31    |       help: consider changing this to be mutable: `mut arg`
32
33 error: aborting due to 4 previous errors
34
35 For more information about this error, try `rustc --explain E0596`.