]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unit_arg_empty_blocks.fixed
Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davidtwco
[rust.git] / src / tools / clippy / tests / ui / unit_arg_empty_blocks.fixed
1 // run-rustfix
2 #![warn(clippy::unit_arg)]
3 #![allow(clippy::no_effect, unused_must_use, unused_variables)]
4
5 use std::fmt::Debug;
6
7 fn foo<T: Debug>(t: T) {
8     println!("{:?}", t);
9 }
10
11 fn foo3<T1: Debug, T2: Debug, T3: Debug>(t1: T1, t2: T2, t3: T3) {
12     println!("{:?}, {:?}, {:?}", t1, t2, t3);
13 }
14
15 fn bad() {
16     foo(());
17     foo3((), 2, 2);
18     foo(0);
19     taking_two_units((), ());
20     foo(0);
21     foo(1);
22     taking_three_units((), (), ());
23 }
24
25 fn taking_two_units(a: (), b: ()) {}
26 fn taking_three_units(a: (), b: (), c: ()) {}
27
28 fn main() {
29     bad();
30 }