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