fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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