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

error: passing a unit value to a function
  --> $DIR/unit_arg.rs:66:5
   |
LL |     foo(foo(1));
   |     ^^^^^^^^^^^
   |
help: move the expression in front of the call and replace it with the unit literal `()`
   |
LL ~     foo(1);
LL ~     foo(());
   |

error: passing a unit value to a function
  --> $DIR/unit_arg.rs:67:5
   |
LL | /     foo({
LL | |         foo(1);
LL | |         foo(2);
LL | |     });
   | |______^
   |
help: remove the semicolon from the last statement in the block
   |
LL |         foo(2)
   |
help: or move the expression in front of the call and replace it with the unit literal `()`
   |
LL ~     {
LL +         foo(1);
LL +         foo(2);
LL +     };
LL ~     foo(());
   |

error: passing a unit value to a function
  --> $DIR/unit_arg.rs:72:5
   |
LL | /     b.bar({
LL | |         1;
LL | |     });
   | |______^
   |
help: remove the semicolon from the last statement in the block
   |
LL |         1
   |
help: or move the expression in front of the call and replace it with the unit literal `()`
   |
LL ~     {
LL +         1;
LL +     };
LL ~     b.bar(());
   |

error: passing unit values to a function
  --> $DIR/unit_arg.rs:75:5
   |
LL |     taking_multiple_units(foo(0), foo(1));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: move the expressions in front of the call and replace them with the unit literal `()`
   |
LL ~     foo(0);
LL +     foo(1);
LL ~     taking_multiple_units((), ());
   |

error: passing unit values to a function
  --> $DIR/unit_arg.rs:76:5
   |
LL | /     taking_multiple_units(foo(0), {
LL | |         foo(1);
LL | |         foo(2);
LL | |     });
   | |______^
   |
help: remove the semicolon from the last statement in the block
   |
LL |         foo(2)
   |
help: or move the expressions in front of the call and replace them with the unit literal `()`
   |
LL ~     foo(0);
LL +     {
LL +         foo(1);
LL +         foo(2);
LL +     };
LL ~     taking_multiple_units((), ());
   |

error: passing unit values to a function
  --> $DIR/unit_arg.rs:80:5
   |
LL | /     taking_multiple_units(
LL | |         {
LL | |             foo(0);
LL | |             foo(1);
...  |
LL | |         },
LL | |     );
   | |_____^
   |
help: remove the semicolon from the last statement in the block
   |
LL |             foo(1)
   |
help: remove the semicolon from the last statement in the block
   |
LL |             foo(3)
   |
help: or move the expressions in front of the call and replace them with the unit literal `()`
   |
LL ~     {
LL +         foo(0);
LL +         foo(1);
LL +     };
LL +     {
LL +         foo(2);
LL +         foo(3);
LL +     };
LL +     taking_multiple_units(
LL +         (),
LL +         (),
LL ~     );
   |

error: passing a unit value to a function
  --> $DIR/unit_arg.rs:91:13
   |
LL |     None.or(Some(foo(2)));
   |             ^^^^^^^^^^^^
   |
help: move the expression in front of the call and replace it with the unit literal `()`
   |
LL ~     None.or({
LL +         foo(2);
LL +         Some(())
LL ~     });
   |

error: passing a unit value to a function
  --> $DIR/unit_arg.rs:94:5
   |
LL |     foo(foo(()));
   |     ^^^^^^^^^^^^
   |
help: move the expression in front of the call and replace it with the unit literal `()`
   |
LL ~     foo(());
LL ~     foo(());
   |

error: passing a unit value to a function
  --> $DIR/unit_arg.rs:131:5
   |
LL |     Some(foo(1))
   |     ^^^^^^^^^^^^
   |
help: move the expression in front of the call and replace it with the unit literal `()`
   |
LL ~     foo(1);
LL +     Some(())
   |

error: aborting due to 10 previous errors