about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-11 22:58:26 +0200
committerGitHub <noreply@github.com>2025-06-11 22:58:26 +0200
commitb29c9a3588fb5cad281a1fb006bed87a7f956a44 (patch)
tree6ea16ccfdf94ac6f1cf13da76c4a15ab12ce7d28
parente703dff8fe220b78195c53478e83fb2f68d8499c (diff)
parent6f958ac88fbf83a1b45d2eff59aedf681b4f6723 (diff)
downloadrust-b29c9a3588fb5cad281a1fb006bed87a7f956a44.tar.gz
rust-b29c9a3588fb5cad281a1fb006bed87a7f956a44.zip
Rollup merge of #142305 - GuillaumeGomez:remove-visit_id-EarlyContextAndPass, r=oli-obk
Remove unneeded `check_id` calls as they are already called in `visit_id` in `EarlyContextAndPass` type

Follow-up from [this message](https://github.com/rust-lang/rust/pull/142240/files#r2137474724).

Since `check_id` is already called in `visit_id` which is supposed to be called for each item with an ID, we don't need to manually call `check_id`.

r? `@oli-obk`
-rw-r--r--compiler/rustc_lint/src/early.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/early.rs b/compiler/rustc_lint/src/early.rs
index 4978f293ab7..12666d383f9 100644
--- a/compiler/rustc_lint/src/early.rs
+++ b/compiler/rustc_lint/src/early.rs
@@ -136,7 +136,6 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
         // the AST struct that they wrap (e.g. an item)
         self.with_lint_attrs(s.id, s.attrs(), |cx| {
             lint_callback!(cx, check_stmt, s);
-            cx.check_id(s.id);
         });
         // The visitor for the AST struct wrapped
         // by the statement (e.g. `Item`) will call
@@ -147,7 +146,6 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
 
     fn visit_fn(&mut self, fk: ast_visit::FnKind<'ast>, span: Span, id: ast::NodeId) {
         lint_callback!(self, check_fn, fk, span, id);
-        self.check_id(id);
         ast_visit::walk_fn(self, fk);
     }