7 fn the_answer(ref mut x: u8) { //~ ERROR `ref` directly on a function argument is ignored
14 // Closures should not warn
15 let y = |ref x| { println!("{:?}", x) };
19 //~^ ERROR `ref` on an entire `let` pattern is discouraged
21 //~| SUGGESTION let x = &1;
23 let ref y: (&_, u8) = (&1, 2);
24 //~^ ERROR `ref` on an entire `let` pattern is discouraged
26 //~| SUGGESTION let y: &(&_, u8) = &(&1, 2);
29 //~^ ERROR `ref` on an entire `let` pattern is discouraged
31 //~| SUGGESTION let z = &(1 + 2);
33 let ref mut z = 1 + 2;
34 //~^ ERROR `ref` on an entire `let` pattern is discouraged
36 //~| SUGGESTION let z = &mut (1 + 2);
38 let (ref x, _) = (1,2); // okay, not top level
39 println!("The answer is {}.", x);