]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unit_arg_empty_blocks.rs
Rollup merge of #102625 - Rageking8:fix-backtrace-small-typo, r=m-ou-se
[rust.git] / src / tools / clippy / tests / ui / unit_arg_empty_blocks.rs
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     taking_two_units({}, foo(0));
20     taking_three_units({}, foo(0), foo(1));
21 }
22
23 fn taking_two_units(a: (), b: ()) {}
24 fn taking_three_units(a: (), b: (), c: ()) {}
25
26 fn main() {
27     bad();
28 }