11error: unnecessary parentheses around `return` value
2-   --> $DIR/lint-unnecessary-parens.rs:13 :12
2+   --> $DIR/lint-unnecessary-parens.rs:14 :12
33   |
44LL |     return (1);
55   |            ^ ^
@@ -16,7 +16,7 @@ LL +     return 1;
1616   |
1717
1818error: unnecessary parentheses around `return` value
19-   --> $DIR/lint-unnecessary-parens.rs:16 :12
19+   --> $DIR/lint-unnecessary-parens.rs:17 :12
2020   |
2121LL |     return (X { y });
2222   |            ^       ^
@@ -28,7 +28,7 @@ LL +     return X { y };
2828   |
2929
3030error: unnecessary parentheses around type
31-   --> $DIR/lint-unnecessary-parens.rs:19 :46
31+   --> $DIR/lint-unnecessary-parens.rs:20 :46
3232   |
3333LL | pub fn unused_parens_around_return_type() -> (u32) {
3434   |                                              ^   ^
@@ -40,7 +40,7 @@ LL + pub fn unused_parens_around_return_type() -> u32 {
4040   |
4141
4242error: unnecessary parentheses around block return value
43-   --> $DIR/lint-unnecessary-parens.rs:25 :9
43+   --> $DIR/lint-unnecessary-parens.rs:26 :9
4444   |
4545LL |         (5)
4646   |         ^ ^
5252   |
5353
5454error: unnecessary parentheses around block return value
55-   --> $DIR/lint-unnecessary-parens.rs:27 :5
55+   --> $DIR/lint-unnecessary-parens.rs:28 :5
5656   |
5757LL |     (5)
5858   |     ^ ^
6464   |
6565
6666error: unnecessary parentheses around `if` condition
67-   --> $DIR/lint-unnecessary-parens.rs:39 :7
67+   --> $DIR/lint-unnecessary-parens.rs:40 :7
6868   |
6969LL |     if(true) {}
7070   |       ^    ^
@@ -76,7 +76,7 @@ LL +     if true {}
7676   |
7777
7878error: unnecessary parentheses around `while` condition
79-   --> $DIR/lint-unnecessary-parens.rs:40 :10
79+   --> $DIR/lint-unnecessary-parens.rs:41 :10
8080   |
8181LL |     while(true) {}
8282   |          ^    ^
@@ -88,7 +88,7 @@ LL +     while true {}
8888   |
8989
9090error: unnecessary parentheses around `for` iterator expression
91-   --> $DIR/lint-unnecessary-parens.rs:41 :13
91+   --> $DIR/lint-unnecessary-parens.rs:42 :13
9292   |
9393LL |     for _ in(e) {}
9494   |             ^ ^
@@ -100,7 +100,7 @@ LL +     for _ in e {}
100100   |
101101
102102error: unnecessary parentheses around `match` scrutinee expression
103-   --> $DIR/lint-unnecessary-parens.rs:42 :10
103+   --> $DIR/lint-unnecessary-parens.rs:43 :10
104104   |
105105LL |     match(1) { _ => ()}
106106   |          ^ ^
@@ -112,7 +112,7 @@ LL +     match 1 { _ => ()}
112112   |
113113
114114error: unnecessary parentheses around `return` value
115-   --> $DIR/lint-unnecessary-parens.rs:43 :11
115+   --> $DIR/lint-unnecessary-parens.rs:44 :11
116116   |
117117LL |     return(1);
118118   |           ^ ^
@@ -124,7 +124,7 @@ LL +     return 1;
124124   |
125125
126126error: unnecessary parentheses around assigned value
127-   --> $DIR/lint-unnecessary-parens.rs:74 :31
127+   --> $DIR/lint-unnecessary-parens.rs:75 :31
128128   |
129129LL | pub const CONST_ITEM: usize = (10);
130130   |                               ^  ^
@@ -136,7 +136,7 @@ LL + pub const CONST_ITEM: usize = 10;
136136   |
137137
138138error: unnecessary parentheses around assigned value
139-   --> $DIR/lint-unnecessary-parens.rs:75 :33
139+   --> $DIR/lint-unnecessary-parens.rs:76 :33
140140   |
141141LL | pub static STATIC_ITEM: usize = (10);
142142   |                                 ^  ^
@@ -148,7 +148,7 @@ LL + pub static STATIC_ITEM: usize = 10;
148148   |
149149
150150error: unnecessary parentheses around function argument
151-   --> $DIR/lint-unnecessary-parens.rs:79 :9
151+   --> $DIR/lint-unnecessary-parens.rs:80 :9
152152   |
153153LL |     bar((true));
154154   |         ^    ^
@@ -160,7 +160,7 @@ LL +     bar(true);
160160   |
161161
162162error: unnecessary parentheses around `if` condition
163-   --> $DIR/lint-unnecessary-parens.rs:81 :8
163+   --> $DIR/lint-unnecessary-parens.rs:82 :8
164164   |
165165LL |     if (true) {}
166166   |        ^    ^
@@ -172,7 +172,7 @@ LL +     if true {}
172172   |
173173
174174error: unnecessary parentheses around `while` condition
175-   --> $DIR/lint-unnecessary-parens.rs:82 :11
175+   --> $DIR/lint-unnecessary-parens.rs:83 :11
176176   |
177177LL |     while (true) {}
178178   |           ^    ^
@@ -184,7 +184,7 @@ LL +     while true {}
184184   |
185185
186186error: unnecessary parentheses around `match` scrutinee expression
187-   --> $DIR/lint-unnecessary-parens.rs:83 :11
187+   --> $DIR/lint-unnecessary-parens.rs:84 :11
188188   |
189189LL |     match (true) {
190190   |           ^    ^
@@ -196,7 +196,7 @@ LL +     match true {
196196   |
197197
198198error: unnecessary parentheses around `let` scrutinee expression
199-   --> $DIR/lint-unnecessary-parens.rs:86 :16
199+   --> $DIR/lint-unnecessary-parens.rs:87 :16
200200   |
201201LL |     if let 1 = (1) {}
202202   |                ^ ^
@@ -208,7 +208,7 @@ LL +     if let 1 = 1 {}
208208   |
209209
210210error: unnecessary parentheses around `let` scrutinee expression
211-   --> $DIR/lint-unnecessary-parens.rs:87 :19
211+   --> $DIR/lint-unnecessary-parens.rs:88 :19
212212   |
213213LL |     while let 1 = (2) {}
214214   |                   ^ ^
@@ -220,7 +220,7 @@ LL +     while let 1 = 2 {}
220220   |
221221
222222error: unnecessary parentheses around method argument
223-   --> $DIR/lint-unnecessary-parens.rs:103 :24
223+   --> $DIR/lint-unnecessary-parens.rs:104 :24
224224   |
225225LL |     X { y: false }.foo((true));
226226   |                        ^    ^
@@ -232,7 +232,7 @@ LL +     X { y: false }.foo(true);
232232   |
233233
234234error: unnecessary parentheses around assigned value
235-   --> $DIR/lint-unnecessary-parens.rs:105 :18
235+   --> $DIR/lint-unnecessary-parens.rs:106 :18
236236   |
237237LL |     let mut _a = (0);
238238   |                  ^ ^
@@ -244,7 +244,7 @@ LL +     let mut _a = 0;
244244   |
245245
246246error: unnecessary parentheses around assigned value
247-   --> $DIR/lint-unnecessary-parens.rs:106 :10
247+   --> $DIR/lint-unnecessary-parens.rs:107 :10
248248   |
249249LL |     _a = (0);
250250   |          ^ ^
@@ -256,7 +256,7 @@ LL +     _a = 0;
256256   |
257257
258258error: unnecessary parentheses around assigned value
259-   --> $DIR/lint-unnecessary-parens.rs:107 :11
259+   --> $DIR/lint-unnecessary-parens.rs:108 :11
260260   |
261261LL |     _a += (1);
262262   |           ^ ^
@@ -268,7 +268,7 @@ LL +     _a += 1;
268268   |
269269
270270error: unnecessary parentheses around pattern
271-   --> $DIR/lint-unnecessary-parens.rs:109 :8
271+   --> $DIR/lint-unnecessary-parens.rs:110 :8
272272   |
273273LL |     let(mut _a) = 3;
274274   |        ^      ^
@@ -280,7 +280,7 @@ LL +     let mut _a = 3;
280280   |
281281
282282error: unnecessary parentheses around pattern
283-   --> $DIR/lint-unnecessary-parens.rs:110 :9
283+   --> $DIR/lint-unnecessary-parens.rs:111 :9
284284   |
285285LL |     let (mut _a) = 3;
286286   |         ^      ^
@@ -292,7 +292,7 @@ LL +     let mut _a = 3;
292292   |
293293
294294error: unnecessary parentheses around pattern
295-   --> $DIR/lint-unnecessary-parens.rs:111 :8
295+   --> $DIR/lint-unnecessary-parens.rs:112 :8
296296   |
297297LL |     let( mut _a) = 3;
298298   |        ^^      ^
@@ -304,7 +304,7 @@ LL +     let mut _a = 3;
304304   |
305305
306306error: unnecessary parentheses around pattern
307-   --> $DIR/lint-unnecessary-parens.rs:113 :8
307+   --> $DIR/lint-unnecessary-parens.rs:114 :8
308308   |
309309LL |     let(_a) = 3;
310310   |        ^  ^
@@ -316,7 +316,7 @@ LL +     let _a = 3;
316316   |
317317
318318error: unnecessary parentheses around pattern
319-   --> $DIR/lint-unnecessary-parens.rs:114 :9
319+   --> $DIR/lint-unnecessary-parens.rs:115 :9
320320   |
321321LL |     let (_a) = 3;
322322   |         ^  ^
@@ -328,7 +328,7 @@ LL +     let _a = 3;
328328   |
329329
330330error: unnecessary parentheses around pattern
331-   --> $DIR/lint-unnecessary-parens.rs:115 :8
331+   --> $DIR/lint-unnecessary-parens.rs:116 :8
332332   |
333333LL |     let( _a) = 3;
334334   |        ^^  ^
@@ -340,7 +340,7 @@ LL +     let _a = 3;
340340   |
341341
342342error: unnecessary parentheses around block return value
343-   --> $DIR/lint-unnecessary-parens.rs:121 :9
343+   --> $DIR/lint-unnecessary-parens.rs:122 :9
344344   |
345345LL |         (unit!() - One)
346346   |         ^             ^
@@ -352,7 +352,7 @@ LL +         unit!() - One
352352   |
353353
354354error: unnecessary parentheses around block return value
355-   --> $DIR/lint-unnecessary-parens.rs:123 :9
355+   --> $DIR/lint-unnecessary-parens.rs:124 :9
356356   |
357357LL |         (unit![] - One)
358358   |         ^             ^
@@ -364,7 +364,7 @@ LL +         unit![] - One
364364   |
365365
366366error: unnecessary parentheses around block return value
367-   --> $DIR/lint-unnecessary-parens.rs:126 :9
367+   --> $DIR/lint-unnecessary-parens.rs:127 :9
368368   |
369369LL |         (unit! {} - One)
370370   |         ^              ^
@@ -375,5 +375,29 @@ LL -         (unit! {} - One)
375375LL +         unit! {} - One
376376   |
377377
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
379403
0 commit comments