]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/let_unit.rs
4 #![warn(let_unit_value)]
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
23 let_and_return
!(()) // should be fine
26 // Related to issue #1964
27 fn consume_units_with_for_loop() {
28 // `for_let_unit` lint should not be triggered by consuming them using for loop.
29 let v
= vec
![(), (), ()];
36 // Same for consuming from some other Iterator<Item = ()>.
37 let (tx
, rx
) = ::std
::sync
::mpsc
::channel();
48 #[derive(Copy, Clone)]
49 pub struct ContainsUnit(()); // should be fine