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