blob: ccd5aa8322f9a894bc3e9ee5063eae6d937a1d0e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:16:5
|
LL | foo({});
| ^^^^--^
| |
| help: use a unit literal instead: `()`
|
= note: `-D clippy::unit-arg` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unit_arg)]`
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:18:5
|
LL | foo3({}, 2, 2);
| ^^^^^--^^^^^^^
| |
| help: use a unit literal instead: `()`
error: passing unit values to a function
--> tests/ui/unit_arg_fixable.rs:20:5
|
LL | taking_two_units({}, foo(0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
LL ~ foo(0);
LL ~ taking_two_units((), ());
|
error: passing unit values to a function
--> tests/ui/unit_arg_fixable.rs:22:5
|
LL | taking_three_units({}, foo(0), foo(1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: move the expressions in front of the call and replace them with the unit literal `()`
|
LL ~ foo(0);
LL + foo(1);
LL ~ taking_three_units((), (), ());
|
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:35:5
|
LL | fn_take_unit(Default::default());
| ^^^^^^^^^^^^^------------------^
| |
| help: use a unit literal instead: `()`
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:49:5
|
LL | fn_take_unit(another_mac!());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
LL ~ another_mac!();
LL ~ fn_take_unit(());
|
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:51:5
|
LL | fn_take_unit(another_mac!(1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
LL ~ another_mac!(1);
LL ~ fn_take_unit(());
|
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:60:5
|
LL | fn_take_unit(mac!(nondef Default::default()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^------------------^^
| |
| help: use a unit literal instead: `()`
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:62:5
|
LL | fn_take_unit(mac!(empty_block));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
LL ~ mac!(empty_block);
LL ~ fn_take_unit(());
|
error: passing a unit value to a function
--> tests/ui/unit_arg_fixable.rs:69:5
|
LL | fn_take_unit(def());
| ^^^^^^^^^^^^^^^^^^^
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
LL ~ let _: () = def();
LL ~ fn_take_unit(());
|
error: aborting due to 10 previous errors
|