blob: ba7a78b8da1a9926f2bafddb69f3351b25e95d15 (
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
error: unnecessary parentheses around `return` value
--> $DIR/lint-unnecessary-parens.rs:13:12
|
LL | return (1);
| ^ ^
|
note: the lint level is defined here
--> $DIR/lint-unnecessary-parens.rs:3:9
|
LL | #![deny(unused_parens)]
| ^^^^^^^^^^^^^
help: remove these parentheses
|
LL - return (1);
LL + return 1;
|
error: unnecessary parentheses around `return` value
--> $DIR/lint-unnecessary-parens.rs:16:12
|
LL | return (X { y });
| ^ ^
|
help: remove these parentheses
|
LL - return (X { y });
LL + return X { y };
|
error: unnecessary parentheses around type
--> $DIR/lint-unnecessary-parens.rs:19:46
|
LL | pub fn unused_parens_around_return_type() -> (u32) {
| ^ ^
|
help: remove these parentheses
|
LL - pub fn unused_parens_around_return_type() -> (u32) {
LL + pub fn unused_parens_around_return_type() -> u32 {
|
error: unnecessary parentheses around block return value
--> $DIR/lint-unnecessary-parens.rs:25:9
|
LL | (5)
| ^ ^
|
help: remove these parentheses
|
LL - (5)
LL + 5
|
error: unnecessary parentheses around block return value
--> $DIR/lint-unnecessary-parens.rs:27:5
|
LL | (5)
| ^ ^
|
help: remove these parentheses
|
LL - (5)
LL + 5
|
error: unnecessary parentheses around `if` condition
--> $DIR/lint-unnecessary-parens.rs:39:7
|
LL | if(true) {}
| ^ ^
|
help: remove these parentheses
|
LL - if(true) {}
LL + if true {}
|
error: unnecessary parentheses around `while` condition
--> $DIR/lint-unnecessary-parens.rs:40:10
|
LL | while(true) {}
| ^ ^
|
help: remove these parentheses
|
LL - while(true) {}
LL + while true {}
|
error: unnecessary parentheses around `for` iterator expression
--> $DIR/lint-unnecessary-parens.rs:41:13
|
LL | for _ in(e) {}
| ^ ^
|
help: remove these parentheses
|
LL - for _ in(e) {}
LL + for _ in e {}
|
error: unnecessary parentheses around `match` scrutinee expression
--> $DIR/lint-unnecessary-parens.rs:42:10
|
LL | match(1) { _ => ()}
| ^ ^
|
help: remove these parentheses
|
LL - match(1) { _ => ()}
LL + match 1 { _ => ()}
|
error: unnecessary parentheses around `return` value
--> $DIR/lint-unnecessary-parens.rs:43:11
|
LL | return(1);
| ^ ^
|
help: remove these parentheses
|
LL - return(1);
LL + return 1;
|
error: unnecessary parentheses around assigned value
--> $DIR/lint-unnecessary-parens.rs:52:31
|
LL | pub const CONST_ITEM: usize = (10);
| ^ ^
|
help: remove these parentheses
|
LL - pub const CONST_ITEM: usize = (10);
LL + pub const CONST_ITEM: usize = 10;
|
error: unnecessary parentheses around assigned value
--> $DIR/lint-unnecessary-parens.rs:53:33
|
LL | pub static STATIC_ITEM: usize = (10);
| ^ ^
|
help: remove these parentheses
|
LL - pub static STATIC_ITEM: usize = (10);
LL + pub static STATIC_ITEM: usize = 10;
|
error: unnecessary parentheses around function argument
--> $DIR/lint-unnecessary-parens.rs:57:9
|
LL | bar((true));
| ^ ^
|
help: remove these parentheses
|
LL - bar((true));
LL + bar(true);
|
error: unnecessary parentheses around `if` condition
--> $DIR/lint-unnecessary-parens.rs:59:8
|
LL | if (true) {}
| ^ ^
|
help: remove these parentheses
|
LL - if (true) {}
LL + if true {}
|
error: unnecessary parentheses around `while` condition
--> $DIR/lint-unnecessary-parens.rs:60:11
|
LL | while (true) {}
| ^ ^
|
help: remove these parentheses
|
LL - while (true) {}
LL + while true {}
|
error: unnecessary parentheses around `match` scrutinee expression
--> $DIR/lint-unnecessary-parens.rs:61:11
|
LL | match (true) {
| ^ ^
|
help: remove these parentheses
|
LL - match (true) {
LL + match true {
|
error: unnecessary parentheses around `let` scrutinee expression
--> $DIR/lint-unnecessary-parens.rs:64:16
|
LL | if let 1 = (1) {}
| ^ ^
|
help: remove these parentheses
|
LL - if let 1 = (1) {}
LL + if let 1 = 1 {}
|
error: unnecessary parentheses around `let` scrutinee expression
--> $DIR/lint-unnecessary-parens.rs:65:19
|
LL | while let 1 = (2) {}
| ^ ^
|
help: remove these parentheses
|
LL - while let 1 = (2) {}
LL + while let 1 = 2 {}
|
error: unnecessary parentheses around method argument
--> $DIR/lint-unnecessary-parens.rs:81:24
|
LL | X { y: false }.foo((true));
| ^ ^
|
help: remove these parentheses
|
LL - X { y: false }.foo((true));
LL + X { y: false }.foo(true);
|
error: unnecessary parentheses around assigned value
--> $DIR/lint-unnecessary-parens.rs:83:18
|
LL | let mut _a = (0);
| ^ ^
|
help: remove these parentheses
|
LL - let mut _a = (0);
LL + let mut _a = 0;
|
error: unnecessary parentheses around assigned value
--> $DIR/lint-unnecessary-parens.rs:84:10
|
LL | _a = (0);
| ^ ^
|
help: remove these parentheses
|
LL - _a = (0);
LL + _a = 0;
|
error: unnecessary parentheses around assigned value
--> $DIR/lint-unnecessary-parens.rs:85:11
|
LL | _a += (1);
| ^ ^
|
help: remove these parentheses
|
LL - _a += (1);
LL + _a += 1;
|
error: unnecessary parentheses around pattern
--> $DIR/lint-unnecessary-parens.rs:87:8
|
LL | let(mut _a) = 3;
| ^ ^
|
help: remove these parentheses
|
LL - let(mut _a) = 3;
LL + let mut _a = 3;
|
error: unnecessary parentheses around pattern
--> $DIR/lint-unnecessary-parens.rs:88:9
|
LL | let (mut _a) = 3;
| ^ ^
|
help: remove these parentheses
|
LL - let (mut _a) = 3;
LL + let mut _a = 3;
|
error: unnecessary parentheses around pattern
--> $DIR/lint-unnecessary-parens.rs:89:8
|
LL | let( mut _a) = 3;
| ^^ ^
|
help: remove these parentheses
|
LL - let( mut _a) = 3;
LL + let mut _a = 3;
|
error: unnecessary parentheses around pattern
--> $DIR/lint-unnecessary-parens.rs:91:8
|
LL | let(_a) = 3;
| ^ ^
|
help: remove these parentheses
|
LL - let(_a) = 3;
LL + let _a = 3;
|
error: unnecessary parentheses around pattern
--> $DIR/lint-unnecessary-parens.rs:92:9
|
LL | let (_a) = 3;
| ^ ^
|
help: remove these parentheses
|
LL - let (_a) = 3;
LL + let _a = 3;
|
error: unnecessary parentheses around pattern
--> $DIR/lint-unnecessary-parens.rs:93:8
|
LL | let( _a) = 3;
| ^^ ^
|
help: remove these parentheses
|
LL - let( _a) = 3;
LL + let _a = 3;
|
error: aborting due to 28 previous errors
|