1
1
error: unnecessary parentheses around `return` value
2
- --> $DIR/lint-unnecessary-parens.rs:13 :12
2
+ --> $DIR/lint-unnecessary-parens.rs:14 :12
3
3
|
4
4
LL | return (1);
5
5
| ^ ^
@@ -16,7 +16,7 @@ LL + return 1;
16
16
|
17
17
18
18
error: unnecessary parentheses around `return` value
19
- --> $DIR/lint-unnecessary-parens.rs:16 :12
19
+ --> $DIR/lint-unnecessary-parens.rs:17 :12
20
20
|
21
21
LL | return (X { y });
22
22
| ^ ^
@@ -28,7 +28,7 @@ LL + return X { y };
28
28
|
29
29
30
30
error: unnecessary parentheses around type
31
- --> $DIR/lint-unnecessary-parens.rs:19 :46
31
+ --> $DIR/lint-unnecessary-parens.rs:20 :46
32
32
|
33
33
LL | pub fn unused_parens_around_return_type() -> (u32) {
34
34
| ^ ^
@@ -40,7 +40,7 @@ LL + pub fn unused_parens_around_return_type() -> u32 {
40
40
|
41
41
42
42
error: unnecessary parentheses around block return value
43
- --> $DIR/lint-unnecessary-parens.rs:25 :9
43
+ --> $DIR/lint-unnecessary-parens.rs:26 :9
44
44
|
45
45
LL | (5)
46
46
| ^ ^
52
52
|
53
53
54
54
error: unnecessary parentheses around block return value
55
- --> $DIR/lint-unnecessary-parens.rs:27 :5
55
+ --> $DIR/lint-unnecessary-parens.rs:28 :5
56
56
|
57
57
LL | (5)
58
58
| ^ ^
64
64
|
65
65
66
66
error: unnecessary parentheses around `if` condition
67
- --> $DIR/lint-unnecessary-parens.rs:39 :7
67
+ --> $DIR/lint-unnecessary-parens.rs:40 :7
68
68
|
69
69
LL | if(true) {}
70
70
| ^ ^
@@ -76,7 +76,7 @@ LL + if true {}
76
76
|
77
77
78
78
error: unnecessary parentheses around `while` condition
79
- --> $DIR/lint-unnecessary-parens.rs:40 :10
79
+ --> $DIR/lint-unnecessary-parens.rs:41 :10
80
80
|
81
81
LL | while(true) {}
82
82
| ^ ^
@@ -88,7 +88,7 @@ LL + while true {}
88
88
|
89
89
90
90
error: unnecessary parentheses around `for` iterator expression
91
- --> $DIR/lint-unnecessary-parens.rs:41 :13
91
+ --> $DIR/lint-unnecessary-parens.rs:42 :13
92
92
|
93
93
LL | for _ in(e) {}
94
94
| ^ ^
@@ -100,7 +100,7 @@ LL + for _ in e {}
100
100
|
101
101
102
102
error: unnecessary parentheses around `match` scrutinee expression
103
- --> $DIR/lint-unnecessary-parens.rs:42 :10
103
+ --> $DIR/lint-unnecessary-parens.rs:43 :10
104
104
|
105
105
LL | match(1) { _ => ()}
106
106
| ^ ^
@@ -112,7 +112,7 @@ LL + match 1 { _ => ()}
112
112
|
113
113
114
114
error: unnecessary parentheses around `return` value
115
- --> $DIR/lint-unnecessary-parens.rs:43 :11
115
+ --> $DIR/lint-unnecessary-parens.rs:44 :11
116
116
|
117
117
LL | return(1);
118
118
| ^ ^
@@ -124,7 +124,7 @@ LL + return 1;
124
124
|
125
125
126
126
error: unnecessary parentheses around assigned value
127
- --> $DIR/lint-unnecessary-parens.rs:74 :31
127
+ --> $DIR/lint-unnecessary-parens.rs:75 :31
128
128
|
129
129
LL | pub const CONST_ITEM: usize = (10);
130
130
| ^ ^
@@ -136,7 +136,7 @@ LL + pub const CONST_ITEM: usize = 10;
136
136
|
137
137
138
138
error: unnecessary parentheses around assigned value
139
- --> $DIR/lint-unnecessary-parens.rs:75 :33
139
+ --> $DIR/lint-unnecessary-parens.rs:76 :33
140
140
|
141
141
LL | pub static STATIC_ITEM: usize = (10);
142
142
| ^ ^
@@ -148,7 +148,7 @@ LL + pub static STATIC_ITEM: usize = 10;
148
148
|
149
149
150
150
error: unnecessary parentheses around function argument
151
- --> $DIR/lint-unnecessary-parens.rs:79 :9
151
+ --> $DIR/lint-unnecessary-parens.rs:80 :9
152
152
|
153
153
LL | bar((true));
154
154
| ^ ^
@@ -160,7 +160,7 @@ LL + bar(true);
160
160
|
161
161
162
162
error: unnecessary parentheses around `if` condition
163
- --> $DIR/lint-unnecessary-parens.rs:81 :8
163
+ --> $DIR/lint-unnecessary-parens.rs:82 :8
164
164
|
165
165
LL | if (true) {}
166
166
| ^ ^
@@ -172,7 +172,7 @@ LL + if true {}
172
172
|
173
173
174
174
error: unnecessary parentheses around `while` condition
175
- --> $DIR/lint-unnecessary-parens.rs:82 :11
175
+ --> $DIR/lint-unnecessary-parens.rs:83 :11
176
176
|
177
177
LL | while (true) {}
178
178
| ^ ^
@@ -184,7 +184,7 @@ LL + while true {}
184
184
|
185
185
186
186
error: unnecessary parentheses around `match` scrutinee expression
187
- --> $DIR/lint-unnecessary-parens.rs:83 :11
187
+ --> $DIR/lint-unnecessary-parens.rs:84 :11
188
188
|
189
189
LL | match (true) {
190
190
| ^ ^
@@ -196,7 +196,7 @@ LL + match true {
196
196
|
197
197
198
198
error: unnecessary parentheses around `let` scrutinee expression
199
- --> $DIR/lint-unnecessary-parens.rs:86 :16
199
+ --> $DIR/lint-unnecessary-parens.rs:87 :16
200
200
|
201
201
LL | if let 1 = (1) {}
202
202
| ^ ^
@@ -208,7 +208,7 @@ LL + if let 1 = 1 {}
208
208
|
209
209
210
210
error: unnecessary parentheses around `let` scrutinee expression
211
- --> $DIR/lint-unnecessary-parens.rs:87 :19
211
+ --> $DIR/lint-unnecessary-parens.rs:88 :19
212
212
|
213
213
LL | while let 1 = (2) {}
214
214
| ^ ^
@@ -220,7 +220,7 @@ LL + while let 1 = 2 {}
220
220
|
221
221
222
222
error: unnecessary parentheses around method argument
223
- --> $DIR/lint-unnecessary-parens.rs:103 :24
223
+ --> $DIR/lint-unnecessary-parens.rs:104 :24
224
224
|
225
225
LL | X { y: false }.foo((true));
226
226
| ^ ^
@@ -232,7 +232,7 @@ LL + X { y: false }.foo(true);
232
232
|
233
233
234
234
error: unnecessary parentheses around assigned value
235
- --> $DIR/lint-unnecessary-parens.rs:105 :18
235
+ --> $DIR/lint-unnecessary-parens.rs:106 :18
236
236
|
237
237
LL | let mut _a = (0);
238
238
| ^ ^
@@ -244,7 +244,7 @@ LL + let mut _a = 0;
244
244
|
245
245
246
246
error: unnecessary parentheses around assigned value
247
- --> $DIR/lint-unnecessary-parens.rs:106 :10
247
+ --> $DIR/lint-unnecessary-parens.rs:107 :10
248
248
|
249
249
LL | _a = (0);
250
250
| ^ ^
@@ -256,7 +256,7 @@ LL + _a = 0;
256
256
|
257
257
258
258
error: unnecessary parentheses around assigned value
259
- --> $DIR/lint-unnecessary-parens.rs:107 :11
259
+ --> $DIR/lint-unnecessary-parens.rs:108 :11
260
260
|
261
261
LL | _a += (1);
262
262
| ^ ^
@@ -268,7 +268,7 @@ LL + _a += 1;
268
268
|
269
269
270
270
error: unnecessary parentheses around pattern
271
- --> $DIR/lint-unnecessary-parens.rs:109 :8
271
+ --> $DIR/lint-unnecessary-parens.rs:110 :8
272
272
|
273
273
LL | let(mut _a) = 3;
274
274
| ^ ^
@@ -280,7 +280,7 @@ LL + let mut _a = 3;
280
280
|
281
281
282
282
error: unnecessary parentheses around pattern
283
- --> $DIR/lint-unnecessary-parens.rs:110 :9
283
+ --> $DIR/lint-unnecessary-parens.rs:111 :9
284
284
|
285
285
LL | let (mut _a) = 3;
286
286
| ^ ^
@@ -292,7 +292,7 @@ LL + let mut _a = 3;
292
292
|
293
293
294
294
error: unnecessary parentheses around pattern
295
- --> $DIR/lint-unnecessary-parens.rs:111 :8
295
+ --> $DIR/lint-unnecessary-parens.rs:112 :8
296
296
|
297
297
LL | let( mut _a) = 3;
298
298
| ^^ ^
@@ -304,7 +304,7 @@ LL + let mut _a = 3;
304
304
|
305
305
306
306
error: unnecessary parentheses around pattern
307
- --> $DIR/lint-unnecessary-parens.rs:113 :8
307
+ --> $DIR/lint-unnecessary-parens.rs:114 :8
308
308
|
309
309
LL | let(_a) = 3;
310
310
| ^ ^
@@ -316,7 +316,7 @@ LL + let _a = 3;
316
316
|
317
317
318
318
error: unnecessary parentheses around pattern
319
- --> $DIR/lint-unnecessary-parens.rs:114 :9
319
+ --> $DIR/lint-unnecessary-parens.rs:115 :9
320
320
|
321
321
LL | let (_a) = 3;
322
322
| ^ ^
@@ -328,7 +328,7 @@ LL + let _a = 3;
328
328
|
329
329
330
330
error: unnecessary parentheses around pattern
331
- --> $DIR/lint-unnecessary-parens.rs:115 :8
331
+ --> $DIR/lint-unnecessary-parens.rs:116 :8
332
332
|
333
333
LL | let( _a) = 3;
334
334
| ^^ ^
@@ -340,7 +340,7 @@ LL + let _a = 3;
340
340
|
341
341
342
342
error: unnecessary parentheses around block return value
343
- --> $DIR/lint-unnecessary-parens.rs:121 :9
343
+ --> $DIR/lint-unnecessary-parens.rs:122 :9
344
344
|
345
345
LL | (unit!() - One)
346
346
| ^ ^
@@ -352,7 +352,7 @@ LL + unit!() - One
352
352
|
353
353
354
354
error: unnecessary parentheses around block return value
355
- --> $DIR/lint-unnecessary-parens.rs:123 :9
355
+ --> $DIR/lint-unnecessary-parens.rs:124 :9
356
356
|
357
357
LL | (unit![] - One)
358
358
| ^ ^
@@ -364,7 +364,7 @@ LL + unit![] - One
364
364
|
365
365
366
366
error: unnecessary parentheses around block return value
367
- --> $DIR/lint-unnecessary-parens.rs:126 :9
367
+ --> $DIR/lint-unnecessary-parens.rs:127 :9
368
368
|
369
369
LL | (unit! {} - One)
370
370
| ^ ^
@@ -375,5 +375,29 @@ LL - (unit! {} - One)
375
375
LL + unit! {} - One
376
376
|
377
377
378
- error: aborting due to 31 previous errors
378
+ error: unnecessary parentheses around assigned value
379
+ --> $DIR/lint-unnecessary-parens.rs:132:14
380
+ |
381
+ LL | let _r = (&x);
382
+ | ^ ^
383
+ |
384
+ help: remove these parentheses
385
+ |
386
+ LL - let _r = (&x);
387
+ LL + let _r = &x;
388
+ |
389
+
390
+ error: unnecessary parentheses around assigned value
391
+ --> $DIR/lint-unnecessary-parens.rs:133:14
392
+ |
393
+ LL | let _r = (&mut x);
394
+ | ^ ^
395
+ |
396
+ help: remove these parentheses
397
+ |
398
+ LL - let _r = (&mut x);
399
+ LL + let _r = &mut x;
400
+ |
401
+
402
+ error: aborting due to 33 previous errors
379
403
0 commit comments