]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mut/mut-suggestion.rs
Rollup merge of #106353 - lukas-code:reduce-red-lines-in-my-ide, r=wesleywiser
[rust.git] / src / test / ui / mut / mut-suggestion.rs
1 #[derive(Copy, Clone)]
2 struct S;
3
4 impl S {
5     fn mutate(&mut self) {
6     }
7 }
8
9 fn func(arg: S) {
10     //~^ HELP consider changing this to be mutable
11     //~| SUGGESTION mut
12     arg.mutate();
13     //~^ ERROR cannot borrow `arg` as mutable, as it is not declared as mutable
14 }
15
16 fn main() {
17     let local = S;
18     //~^ HELP consider changing this to be mutable
19     //~| SUGGESTION mut
20     local.mutate();
21     //~^ ERROR cannot borrow `local` as mutable, as it is not declared as mutable
22 }