fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.3 KiB35 linesraw
1error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
2  --> $DIR/borrowck-argument.rs:10:5
3   |
4LL | fn func(arg: S) {
5   |         --- help: consider changing this to be mutable: `mut arg`
6LL |     arg.mutate();
7   |     ^^^ cannot borrow as mutable
8
9error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
10  --> $DIR/borrowck-argument.rs:15:9
11   |
12LL |     fn method(&self, arg: S) {
13   |                      --- help: consider changing this to be mutable: `mut arg`
14LL |         arg.mutate();
15   |         ^^^ cannot borrow as mutable
16
17error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
18  --> $DIR/borrowck-argument.rs:21:9
19   |
20LL |     fn default(&self, arg: S) {
21   |                       --- help: consider changing this to be mutable: `mut arg`
22LL |         arg.mutate();
23   |         ^^^ cannot borrow as mutable
24
25error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
26  --> $DIR/borrowck-argument.rs:32:17
27   |
28LL |     (|arg: S| { arg.mutate() })(s);
29   |       ---       ^^^ cannot borrow as mutable
30   |       |
31   |       help: consider changing this to be mutable: `mut arg`
32
33error: aborting due to 4 previous errors
34
35For more information about this error, try `rustc --explain E0596`.