3 #![warn(clippy::let_unit_value)]
4 #![allow(clippy::no_effect)]
5 #![allow(unused_variables)]
7 macro_rules! let_and_return {
14 let _x = println!("x");
15 let _y = 1; // this is fine
16 let _z = ((), 1); // this as well
21 consume_units_with_for_loop(); // should be fine as well
25 let_and_return!(()) // should be fine
28 // Related to issue #1964
29 fn consume_units_with_for_loop() {
30 // `for_let_unit` lint should not be triggered by consuming them using for loop.
31 let v = vec![(), (), ()];
38 // Same for consuming from some other Iterator<Item = ()>.
39 let (tx, rx) = ::std::sync::mpsc::channel();
51 let v: Vec<u8> = vec![2];
56 .filter(|i| i % 2 == 0)
62 #[derive(Copy, Clone)]
63 pub struct ContainsUnit(()); // should be fine