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