|
1 | 1 | error: passing a unit value to a function |
2 | | - --> $DIR/unit_arg.rs:24:5 |
| 2 | + --> $DIR/unit_arg.rs:23:5 |
3 | 3 | | |
4 | 4 | LL | foo({}); |
5 | 5 | | ^^^^^^^ |
6 | 6 | | |
7 | 7 | = note: `-D clippy::unit-arg` implied by `-D warnings` |
8 | | -help: move the expressions in front of the call... |
| 8 | +help: move the expression in front of the call... |
9 | 9 | | |
10 | | -LL | {}; foo({}); |
11 | | - | ^^^ |
12 | | -help: ...and use unit literals instead |
| 10 | +LL | {}; |
| 11 | + | |
| 12 | +help: ...and use a unit literal instead |
13 | 13 | | |
14 | 14 | LL | foo(()); |
15 | 15 | | ^^ |
16 | 16 |
|
17 | 17 | error: passing a unit value to a function |
18 | | - --> $DIR/unit_arg.rs:25:5 |
| 18 | + --> $DIR/unit_arg.rs:24:5 |
19 | 19 | | |
20 | 20 | LL | / foo({ |
21 | 21 | LL | | 1; |
22 | 22 | LL | | }); |
23 | 23 | | |______^ |
24 | 24 | | |
25 | | -help: move the expressions in front of the call... |
| 25 | +help: remove the semicolon from the last statement in the block |
| 26 | + | |
| 27 | +LL | 1 |
| 28 | + | |
| 29 | +help: or move the expression in front of the call... |
26 | 30 | | |
27 | 31 | LL | { |
28 | 32 | LL | 1; |
29 | | -LL | }; foo({ |
| 33 | +LL | }; |
30 | 34 | | |
31 | | -help: ...and use unit literals instead |
| 35 | +help: ...and use a unit literal instead |
32 | 36 | | |
33 | 37 | LL | foo(()); |
34 | 38 | | ^^ |
35 | 39 |
|
36 | 40 | error: passing a unit value to a function |
37 | | - --> $DIR/unit_arg.rs:28:5 |
| 41 | + --> $DIR/unit_arg.rs:27:5 |
38 | 42 | | |
39 | 43 | LL | foo(foo(1)); |
40 | 44 | | ^^^^^^^^^^^ |
41 | 45 | | |
42 | | -help: move the expressions in front of the call... |
| 46 | +help: move the expression in front of the call... |
43 | 47 | | |
44 | | -LL | foo(1); foo(foo(1)); |
45 | | - | ^^^^^^^ |
46 | | -help: ...and use unit literals instead |
| 48 | +LL | foo(1); |
| 49 | + | |
| 50 | +help: ...and use a unit literal instead |
47 | 51 | | |
48 | 52 | LL | foo(()); |
49 | 53 | | ^^ |
50 | 54 |
|
51 | 55 | error: passing a unit value to a function |
52 | | - --> $DIR/unit_arg.rs:29:5 |
| 56 | + --> $DIR/unit_arg.rs:28:5 |
53 | 57 | | |
54 | 58 | LL | / foo({ |
55 | 59 | LL | | foo(1); |
56 | 60 | LL | | foo(2); |
57 | 61 | LL | | }); |
58 | 62 | | |______^ |
59 | 63 | | |
60 | | -help: move the expressions in front of the call... |
| 64 | +help: remove the semicolon from the last statement in the block |
| 65 | + | |
| 66 | +LL | foo(2) |
| 67 | + | |
| 68 | +help: or move the expression in front of the call... |
61 | 69 | | |
62 | 70 | LL | { |
63 | 71 | LL | foo(1); |
64 | 72 | LL | foo(2); |
65 | | -LL | }; foo({ |
| 73 | +LL | }; |
66 | 74 | | |
67 | | -help: ...and use unit literals instead |
| 75 | +help: ...and use a unit literal instead |
68 | 76 | | |
69 | 77 | LL | foo(()); |
70 | 78 | | ^^ |
71 | 79 |
|
72 | 80 | error: passing a unit value to a function |
73 | | - --> $DIR/unit_arg.rs:33:5 |
| 81 | + --> $DIR/unit_arg.rs:32:5 |
74 | 82 | | |
75 | 83 | LL | foo3({}, 2, 2); |
76 | 84 | | ^^^^^^^^^^^^^^ |
77 | 85 | | |
78 | | -help: move the expressions in front of the call... |
| 86 | +help: move the expression in front of the call... |
79 | 87 | | |
80 | | -LL | {}; foo3({}, 2, 2); |
81 | | - | ^^^ |
82 | | -help: ...and use unit literals instead |
| 88 | +LL | {}; |
| 89 | + | |
| 90 | +help: ...and use a unit literal instead |
83 | 91 | | |
84 | 92 | LL | foo3((), 2, 2); |
85 | 93 | | ^^ |
86 | 94 |
|
87 | 95 | error: passing a unit value to a function |
88 | | - --> $DIR/unit_arg.rs:35:5 |
| 96 | + --> $DIR/unit_arg.rs:34:5 |
89 | 97 | | |
90 | 98 | LL | / b.bar({ |
91 | 99 | LL | | 1; |
92 | 100 | LL | | }); |
93 | 101 | | |______^ |
94 | 102 | | |
95 | | -help: move the expressions in front of the call... |
| 103 | +help: remove the semicolon from the last statement in the block |
| 104 | + | |
| 105 | +LL | 1 |
| 106 | + | |
| 107 | +help: or move the expression in front of the call... |
96 | 108 | | |
97 | 109 | LL | { |
98 | 110 | LL | 1; |
99 | | -LL | }; b.bar({ |
| 111 | +LL | }; |
100 | 112 | | |
101 | | -help: ...and use unit literals instead |
| 113 | +help: ...and use a unit literal instead |
102 | 114 | | |
103 | 115 | LL | b.bar(()); |
104 | 116 | | ^^ |
105 | 117 |
|
106 | | -error: passing a unit value to a function |
107 | | - --> $DIR/unit_arg.rs:38:5 |
| 118 | +error: passing unit values to a function |
| 119 | + --> $DIR/unit_arg.rs:37:5 |
108 | 120 | | |
109 | 121 | LL | taking_multiple_units(foo(0), foo(1)); |
110 | 122 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
111 | 123 | | |
112 | 124 | help: move the expressions in front of the call... |
113 | 125 | | |
114 | | -LL | foo(0); foo(1); taking_multiple_units(foo(0), foo(1)); |
115 | | - | ^^^^^^^^^^^^^^^ |
| 126 | +LL | foo(0); |
| 127 | +LL | foo(1); |
| 128 | + | |
116 | 129 | help: ...and use unit literals instead |
117 | 130 | | |
118 | | -LL | taking_multiple_units((), foo(1)); |
119 | | - | ^^ |
| 131 | +LL | taking_multiple_units((), ()); |
| 132 | + | ^^ ^^ |
| 133 | + |
| 134 | +error: passing unit values to a function |
| 135 | + --> $DIR/unit_arg.rs:38:5 |
| 136 | + | |
| 137 | +LL | / taking_multiple_units(foo(0), { |
| 138 | +LL | | foo(1); |
| 139 | +LL | | foo(2); |
| 140 | +LL | | }); |
| 141 | + | |______^ |
| 142 | + | |
| 143 | +help: remove the semicolon from the last statement in the block |
| 144 | + | |
| 145 | +LL | foo(2) |
| 146 | + | |
| 147 | +help: or move the expressions in front of the call... |
| 148 | + | |
| 149 | +LL | foo(0); |
| 150 | +LL | { |
| 151 | +LL | foo(1); |
| 152 | +LL | foo(2); |
| 153 | +LL | }; |
| 154 | + | |
120 | 155 | help: ...and use unit literals instead |
121 | 156 | | |
122 | | -LL | taking_multiple_units(foo(0), ()); |
123 | | - | ^^ |
| 157 | +LL | taking_multiple_units((), ()); |
| 158 | + | ^^ ^^ |
| 159 | + |
| 160 | +error: passing unit values to a function |
| 161 | + --> $DIR/unit_arg.rs:42:5 |
| 162 | + | |
| 163 | +LL | / taking_multiple_units( |
| 164 | +LL | | { |
| 165 | +LL | | foo(0); |
| 166 | +LL | | foo(1); |
| 167 | +... | |
| 168 | +LL | | }, |
| 169 | +LL | | ); |
| 170 | + | |_____^ |
| 171 | + | |
| 172 | +help: remove the semicolon from the last statement in the block |
| 173 | + | |
| 174 | +LL | foo(1) |
| 175 | + | |
| 176 | +help: remove the semicolon from the last statement in the block |
| 177 | + | |
| 178 | +LL | foo(3) |
| 179 | + | |
| 180 | +help: or move the expressions in front of the call... |
| 181 | + | |
| 182 | +LL | { |
| 183 | +LL | foo(0); |
| 184 | +LL | foo(1); |
| 185 | +LL | }; |
| 186 | +LL | { |
| 187 | +LL | foo(2); |
| 188 | + ... |
| 189 | +help: ...and use unit literals instead |
| 190 | + | |
| 191 | +LL | (), |
| 192 | +LL | (), |
| 193 | + | |
124 | 194 |
|
125 | 195 | error: passing a unit value to a function |
126 | | - --> $DIR/unit_arg.rs:71:5 |
| 196 | + --> $DIR/unit_arg.rs:84:5 |
127 | 197 | | |
128 | 198 | LL | Some(foo(1)) |
129 | 199 | | ^^^^^^^^^^^^ |
130 | 200 | | |
131 | | -help: move the expressions in front of the call... |
| 201 | +help: move the expression in front of the call... |
132 | 202 | | |
133 | | -LL | foo(1); Some(foo(1)) |
134 | | - | ^^^^^^^ |
135 | | -help: ...and use unit literals instead |
| 203 | +LL | foo(1); |
| 204 | + | |
| 205 | +help: ...and use a unit literal instead |
136 | 206 | | |
137 | 207 | LL | Some(()) |
138 | 208 | | ^^ |
139 | 209 |
|
140 | | -error: aborting due to 8 previous errors |
| 210 | +error: aborting due to 10 previous errors |
141 | 211 |
|
0 commit comments