Auto merge of #142398 - fee1-dead-contrib:push-ynxrtswtkyxw, r=oli-obk

early linting: avoid redundant calls to `check_id`

An attempt to address the regression at https://github.com/rust-lang/rust/pull/142240#issuecomment-2964425460

r? `@oli-obk`

cc `@nnethercote` who might have a better understanding of the performance implications
This commit is contained in:
bors
2025-06-15 09:17:15 +00:00
3 changed files with 18 additions and 29 deletions

View File

@@ -1700,7 +1700,8 @@ fn visit_nested_use_tree<'a, V: Visitor<'a>>(
}
pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) -> V::Result {
let Stmt { id: _, kind, span: _ } = statement;
let Stmt { id, kind, span: _ } = statement;
try_visit!(visit_id(visitor, id));
match kind {
StmtKind::Let(local) => try_visit!(visitor.visit_local(local)),
StmtKind::Item(item) => try_visit!(visitor.visit_item(item)),