]> git.proxmox.com Git - rustc.git/blob - tests/ui/suggestions/suggest-ref-mut.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / suggestions / suggest-ref-mut.rs
1 struct X(usize);
2
3 impl X {
4 fn zap(&self) {
5 //~^ HELP
6 //~| SUGGESTION &mut self
7 self.0 = 32;
8 //~^ ERROR
9 }
10 }
11
12 fn main() {
13 let ref foo = 16;
14 //~^ HELP
15 //~| SUGGESTION ref mut foo
16 *foo = 32;
17 //~^ ERROR
18 if let Some(ref bar) = Some(16) {
19 //~^ HELP
20 //~| SUGGESTION ref mut bar
21 *bar = 32;
22 //~^ ERROR
23 }
24 match 16 {
25 ref quo => { *quo = 32; },
26 //~^ ERROR
27 //~| HELP
28 //~| SUGGESTION ref mut quo
29 }
30 }