about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/unused.rs
diff options
context:
space:
mode:
authorMax Niederman <max@maxniederman.com>2024-08-22 16:49:45 -0700
committerNadrieril <nadrieril+git@gmail.com>2024-11-24 18:08:20 +0100
commit9b8bfed73b7ff55cbc3041c73283c12279221cbf (patch)
tree7b185592422b6bbe22de49a1c89b33627f475c67 /compiler/rustc_lint/src/unused.rs
parent35bbc45f1651024579ff9091698684ef4a1609ca (diff)
downloadrust-9b8bfed73b7ff55cbc3041c73283c12279221cbf.tar.gz
rust-9b8bfed73b7ff55cbc3041c73283c12279221cbf.zip
add guard pattern AST node
Diffstat (limited to 'compiler/rustc_lint/src/unused.rs')
-rw-r--r--compiler/rustc_lint/src/unused.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs
index 5ec920d39f4..adf157fd0bf 100644
--- a/compiler/rustc_lint/src/unused.rs
+++ b/compiler/rustc_lint/src/unused.rs
@@ -1235,7 +1235,7 @@ impl EarlyLintPass for UnusedParens {
                 self.check_unused_parens_pat(cx, &f.pat, false, false, keep_space);
             },
             // Avoid linting on `i @ (p0 | .. | pn)` and `box (p0 | .. | pn)`, #64106.
-            Ident(.., Some(p)) | Box(p) | Deref(p) => self.check_unused_parens_pat(cx, p, true, false, keep_space),
+            Ident(.., Some(p)) | Box(p) | Deref(p) | Guard(p, _) => self.check_unused_parens_pat(cx, p, true, false, keep_space),
             // Avoid linting on `&(mut x)` as `&mut x` has a different meaning, #55342.
             // Also avoid linting on `& mut? (p0 | .. | pn)`, #64106.
             Ref(p, m) => self.check_unused_parens_pat(cx, p, true, *m == Mutability::Not, keep_space),