]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unit_arg_empty_blocks.rs
Auto merge of #97944 - nikic:freebsd-update, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / unit_arg_empty_blocks.rs
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     taking_two_units({}, foo(0));
19     taking_three_units({}, foo(0), foo(1));
20 }
21
22 fn taking_two_units(a: (), b: ()) {}
23 fn taking_three_units(a: (), b: (), c: ()) {}
24
25 fn main() {
26     bad();
27 }