3 #![warn(clippy::toplevel_ref_arg)]
7 // Closures should not warn
8 let y = |ref x| println!("{:?}", x);
13 let ref y: (&_, u8) = (&1, 2);
17 let ref mut z = 1 + 2;
19 let (ref x, _) = (1, 2); // ok, not top level
20 println!("The answer is {}.", x);
22 let ref x = vec![1, 2, 3];
24 // Make sure that allowing the lint works
25 #[allow(clippy::toplevel_ref_arg)]
26 let ref mut x = 1_234_543;