diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2025-06-01 02:38:24 +0000 | 
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2025-06-01 02:38:24 +0000 | 
| commit | c33b08552b7741828488ada70afdce12122fd97b (patch) | |
| tree | 71f4ec2a1d18ba4702bf7777f7a8209796a9552f /compiler/rustc_resolve/src | |
| parent | 738c08b63c4f9e3ebdaec5eece7b6fbc354f6467 (diff) | |
| download | rust-c33b08552b7741828488ada70afdce12122fd97b.tar.gz rust-c33b08552b7741828488ada70afdce12122fd97b.zip | |
Add `visit_id` to ast `Visitor`
This helps with efforts to deduplicate the `MutVisitor` and the `Visitor` code. All users of `Visitor`'s methods that have extra `NodeId` as parameters really just want to visit the id on its own. Also includes some methods deduplicated and cleaned up as a result of this change.
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late.rs | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index fb1534d0b27..bef0c2b6b14 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -870,7 +870,7 @@ impl<'ra: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'r kind: LifetimeBinderKind::PolyTrait, span, }, - |this| this.visit_path(path, ty.id), + |this| this.visit_path(path), ); } else { visit::walk_ty(self, ty) @@ -1261,7 +1261,7 @@ impl<'ra: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'r AnonConstKind::ConstArg(IsRepeatExpr::No), |this| { this.smart_resolve_path(ty.id, &None, path, PathSource::Expr(None)); - this.visit_path(path, ty.id); + this.visit_path(path); }, ); @@ -3636,7 +3636,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { if let Some(qself) = &delegation.qself { self.visit_ty(&qself.ty); } - self.visit_path(&delegation.path, delegation.id); + self.visit_path(&delegation.path); let Some(body) = &delegation.body else { return }; self.with_rib(ValueNS, RibKind::FnOrCoroutine, |this| { let span = delegation.path.segments.last().unwrap().ident.span; @@ -4860,7 +4860,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { if let Some(qself) = &se.qself { self.visit_ty(&qself.ty); } - self.visit_path(&se.path, expr.id); + self.visit_path(&se.path); walk_list!(self, resolve_expr_field, &se.fields, expr); match &se.rest { StructRest::Base(expr) => self.visit_expr(expr), | 
