let_chains: Adjust unnecessary parens tests.
This commit is contained in:
parent
c0c5791049
commit
6a6b07906f
2 changed files with 4 additions and 4 deletions
|
@ -22,8 +22,8 @@ fn main() {
|
|||
match (true) { //~ ERROR unnecessary parentheses around `match` head expression
|
||||
_ => {}
|
||||
}
|
||||
if let 1 = (1) {} //~ ERROR unnecessary parentheses around `if let` head expression
|
||||
while let 1 = (2) {} //~ ERROR unnecessary parentheses around `while let` head expression
|
||||
if let 1 = (1) {} //~ ERROR unnecessary parentheses around `let` scrutinee
|
||||
while let 1 = (2) {} //~ ERROR unnecessary parentheses around `let` scrutinee
|
||||
let v = X { y: false };
|
||||
// struct lits needs parens, so these shouldn't warn.
|
||||
if (v == X { y: true }) {}
|
||||
|
|
|
@ -40,13 +40,13 @@ error: unnecessary parentheses around `match` head expression
|
|||
LL | match (true) {
|
||||
| ^^^^^^ help: remove these parentheses
|
||||
|
||||
error: unnecessary parentheses around `if let` head expression
|
||||
error: unnecessary parentheses around `let` scrutinee
|
||||
--> $DIR/lint-unnecessary-parens.rs:25:16
|
||||
|
|
||||
LL | if let 1 = (1) {}
|
||||
| ^^^ help: remove these parentheses
|
||||
|
||||
error: unnecessary parentheses around `while let` head expression
|
||||
error: unnecessary parentheses around `let` scrutinee
|
||||
--> $DIR/lint-unnecessary-parens.rs:26:19
|
||||
|
|
||||
LL | while let 1 = (2) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue