about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-03-26 11:16:09 -0400
committerMichael Goulet <michael@errs.io>2024-03-26 11:16:49 -0400
commit950b40f1119ebe5ae51555ca7d236a899b604a4c (patch)
tree825e000b37dcdf62aeb64aa66e23d5ee34974a53 /compiler/rustc_lint
parent519d892f9523fe40cc11ec07323ffc2792614742 (diff)
downloadrust-950b40f1119ebe5ae51555ca7d236a899b604a4c.tar.gz
rust-950b40f1119ebe5ae51555ca7d236a899b604a4c.zip
Don't check match scrutinee of postfix match for unused parens
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/unused.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs
index 0b757f95a99..111a4fdcea1 100644
--- a/compiler/rustc_lint/src/unused.rs
+++ b/compiler/rustc_lint/src/unused.rs
@@ -865,7 +865,9 @@ trait UnusedDelimLint {
                 (iter, UnusedDelimsCtx::ForIterExpr, true, None, Some(body.span.lo()), true)
             }
 
-            Match(ref head, ..) if Self::LINT_EXPR_IN_PATTERN_MATCHING_CTX => {
+            Match(ref head, _, ast::MatchKind::Prefix)
+                if Self::LINT_EXPR_IN_PATTERN_MATCHING_CTX =>
+            {
                 let left = e.span.lo() + rustc_span::BytePos(5);
                 (head, UnusedDelimsCtx::MatchScrutineeExpr, true, Some(left), None, true)
             }