]> git.lizzy.rs Git - rust.git/blob - tests/ui/unit_arg.stderr
removing unsafe from test fn's && renaming shrink to sugg_span
[rust.git] / tests / ui / unit_arg.stderr
1 error: passing a unit value to a function
2   --> $DIR/unit_arg.rs:56: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:59: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:60: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:65: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:68: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:69: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:73: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  ...
141
142 error: passing a unit value to a function
143   --> $DIR/unit_arg.rs:84:13
144    |
145 LL |     None.or(Some(foo(2)));
146    |             ^^^^^^^^^^^^
147    |
148 help: move the expression in front of the call and replace it with the unit literal `()`
149    |
150 LL ~     None.or({
151 LL +         foo(2);
152 LL +         Some(())
153 LL ~     });
154    |
155
156 error: passing a unit value to a function
157   --> $DIR/unit_arg.rs:87:5
158    |
159 LL |     foo(foo(()));
160    |     ^^^^^^^^^^^^
161    |
162 help: move the expression in front of the call and replace it with the unit literal `()`
163    |
164 LL ~     foo(());
165 LL ~     foo(());
166    |
167
168 error: passing a unit value to a function
169   --> $DIR/unit_arg.rs:124:5
170    |
171 LL |     Some(foo(1))
172    |     ^^^^^^^^^^^^
173    |
174 help: move the expression in front of the call and replace it with the unit literal `()`
175    |
176 LL ~     foo(1);
177 LL +     Some(())
178    |
179
180 error: aborting due to 10 previous errors
181