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