about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-03-14 01:37:34 -0400
committerGitHub <noreply@github.com>2025-03-14 01:37:34 -0400
commitfb2a7fa209709545bd7f8458ff8618da03ab00eb (patch)
treebdd6720f53c083bcca5b908cd16ff94ca5146444 /compiler
parente928a8f4a05c63ca5e9031741b0ee51e2254f92d (diff)
parent8bf33c213fe752a5a9f6fbc2594316dcbdd5a262 (diff)
downloadrust-fb2a7fa209709545bd7f8458ff8618da03ab00eb.tar.gz
rust-fb2a7fa209709545bd7f8458ff8618da03ab00eb.zip
Rollup merge of #138434 - compiler-errors:lint-level-pat-field, r=jieyouxu
Visit `PatField` when collecting lint levels

Fixes #138428

Side-note, I vaguely skimmed over the other nodes we could be visiting here and it doesn't *seem* to me that we're missing anything, though I may be mistaken given recent(?) support for attrs in where clauses(??). Can be fixed in a follow-up PR.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_lint/src/levels.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs
index aa6eef906ea..8718fb807ec 100644
--- a/compiler/rustc_lint/src/levels.rs
+++ b/compiler/rustc_lint/src/levels.rs
@@ -299,6 +299,11 @@ impl<'tcx> Visitor<'tcx> for LintLevelsBuilder<'_, LintLevelQueryMap<'tcx>> {
         intravisit::walk_expr(self, e);
     }
 
+    fn visit_pat_field(&mut self, f: &'tcx hir::PatField<'tcx>) -> Self::Result {
+        self.add_id(f.hir_id);
+        intravisit::walk_pat_field(self, f);
+    }
+
     fn visit_expr_field(&mut self, f: &'tcx hir::ExprField<'tcx>) {
         self.add_id(f.hir_id);
         intravisit::walk_expr_field(self, f);