3 #![warn(clippy::toplevel_ref_arg)]
6 // Closures should not warn
7 let y = |ref x| println!("{:?}", x);
12 let _y: &(&_, u8) = &(&1, 2);
16 let _z = &mut (1 + 2);
18 let (ref x, _) = (1, 2); // ok, not top level
19 println!("The answer is {}.", x);
21 let _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;
28 for ref _x in 0..10 {}