]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/unit_arg_empty_blocks.fixed
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / unit_arg_empty_blocks.fixed
1 // run-rustfix
2 #![warn(clippy::unit_arg)]
3 #![allow(unused_must_use, unused_variables)]
4 #![allow(clippy::no_effect, clippy::uninlined_format_args)]
5
6 use std::fmt::Debug;
7
8 fn foo<T: Debug>(t: T) {
9 println!("{:?}", t);
10 }
11
12 fn foo3<T1: Debug, T2: Debug, T3: Debug>(t1: T1, t2: T2, t3: T3) {
13 println!("{:?}, {:?}, {:?}", t1, t2, t3);
14 }
15
16 fn bad() {
17 foo(());
18 foo3((), 2, 2);
19 foo(0);
20 taking_two_units((), ());
21 foo(0);
22 foo(1);
23 taking_three_units((), (), ());
24 }
25
26 fn taking_two_units(a: (), b: ()) {}
27 fn taking_three_units(a: (), b: (), c: ()) {}
28
29 fn main() {
30 bad();
31 }