3 #![warn(clippy::toplevel_ref_arg)]
6 // Closures should not warn
7 let y = |ref x| println!("{:?}", x);
12 let ref _y: (&_, u8) = (&1, 2);
16 let ref mut _z = 1 + 2;
18 let (ref x, _) = (1, 2); // ok, not top level
19 println!("The answer is {}.", x);
21 let ref _x = vec![1, 2, 3];
23 // Make sure that allowing the lint works
24 #[allow(clippy::toplevel_ref_arg)]
25 let ref mut _x = 1_234_543;