1 #![warn(clippy::let_unit_value)]
2 #![allow(unused_variables)]
4 macro_rules! let_and_return {
11 let _x = println!("x");
12 let _y = 1; // this is fine
13 let _z = ((), 1); // this as well
18 consume_units_with_for_loop(); // should be fine as well
20 let_and_return!(()) // should be fine
23 // Related to issue #1964
24 fn consume_units_with_for_loop() {
25 // `for_let_unit` lint should not be triggered by consuming them using for loop.
26 let v = vec![(), (), ()];
33 // Same for consuming from some other Iterator<Item = ()>.
34 let (tx, rx) = ::std::sync::mpsc::channel();
45 #[derive(Copy, Clone)]
46 pub struct ContainsUnit(()); // should be fine