]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-argument.stderr
Rollup merge of #106353 - lukas-code:reduce-red-lines-in-my-ide, r=wesleywiser
[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 |     arg.mutate();
5    |     ^^^^^^^^^^^^ cannot borrow as mutable
6    |
7 help: consider changing this to be mutable
8    |
9 LL | fn func(mut arg: S) {
10    |         +++
11
12 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
13   --> $DIR/borrowck-argument.rs:15:9
14    |
15 LL |         arg.mutate();
16    |         ^^^^^^^^^^^^ cannot borrow as mutable
17    |
18 help: consider changing this to be mutable
19    |
20 LL |     fn method(&self, mut arg: S) {
21    |                      +++
22
23 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
24   --> $DIR/borrowck-argument.rs:21:9
25    |
26 LL |         arg.mutate();
27    |         ^^^^^^^^^^^^ cannot borrow as mutable
28    |
29 help: consider changing this to be mutable
30    |
31 LL |     fn default(&self, mut arg: S) {
32    |                       +++
33
34 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
35   --> $DIR/borrowck-argument.rs:32:17
36    |
37 LL |     (|arg: S| { arg.mutate() })(s);
38    |                 ^^^^^^^^^^^^ cannot borrow as mutable
39    |
40 help: consider changing this to be mutable
41    |
42 LL |     (|mut arg: S| { arg.mutate() })(s);
43    |       +++
44
45 error: aborting due to 4 previous errors
46
47 For more information about this error, try `rustc --explain E0596`.