1 #[derive(Copy, Clone)]
2 struct S;
3
4 impl S {
mutate(&mut self)5 fn mutate(&mut self) {
6 }
7 }
8
func(arg: S)9 fn func(arg: S) {
10 //~^ HELP consider changing this to be mutable
11 //~| SUGGESTION mut arg
12 arg.mutate();
13 //~^ ERROR cannot borrow `arg` as mutable, as it is not declared as mutable
14 }
15
main()16 fn main() {
17 let local = S;
18 //~^ HELP consider changing this to be mutable
19 //~| SUGGESTION mut local
20 local.mutate();
21 //~^ ERROR cannot borrow `local` as mutable, as it is not declared as mutable
22 }
23