Skip to content

Commit 2178db4

Browse files
committed
let_chains: scrutinee -> head expression.
1 parent c887d02 commit 2178db4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: src/librustc_lint/unused.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ impl UnusedParens {
313313
ast::ExprKind::Let(_, ref expr) => {
314314
// FIXME(#60336): Properly handle `let true = (false && true)`
315315
// actually needing the parenthesis.
316-
self.check_unused_parens_expr(cx, expr, "`let` scrutinee", followed_by_block);
316+
self.check_unused_parens_expr(cx, expr, "`let` head expression", followed_by_block);
317317
}
318318
_ => {}
319319
}

Diff for: src/test/ui/lint/lint-unnecessary-parens.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ fn main() {
2222
match (true) { //~ ERROR unnecessary parentheses around `match` head expression
2323
_ => {}
2424
}
25-
if let 1 = (1) {} //~ ERROR unnecessary parentheses around `let` scrutinee
26-
while let 1 = (2) {} //~ ERROR unnecessary parentheses around `let` scrutinee
25+
if let 1 = (1) {} //~ ERROR unnecessary parentheses around `let` head expression
26+
while let 1 = (2) {} //~ ERROR unnecessary parentheses around `let` head expression
2727
let v = X { y: false };
2828
// struct lits needs parens, so these shouldn't warn.
2929
if (v == X { y: true }) {}

Diff for: src/test/ui/lint/lint-unnecessary-parens.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ error: unnecessary parentheses around `match` head expression
4040
LL | match (true) {
4141
| ^^^^^^ help: remove these parentheses
4242

43-
error: unnecessary parentheses around `let` scrutinee
43+
error: unnecessary parentheses around `let` head expression
4444
--> $DIR/lint-unnecessary-parens.rs:25:16
4545
|
4646
LL | if let 1 = (1) {}
4747
| ^^^ help: remove these parentheses
4848

49-
error: unnecessary parentheses around `let` scrutinee
49+
error: unnecessary parentheses around `let` head expression
5050
--> $DIR/lint-unnecessary-parens.rs:26:19
5151
|
5252
LL | while let 1 = (2) {}

0 commit comments

Comments
 (0)