From f21a98d8a9b6343effc4743dbb95507778181937 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 27 Jun 2018 11:41:21 +0200 Subject: [PATCH] Explain the lack of item recursion --- src/librustc/hir/intravisit.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index f2d1678d3369..e06563f90e00 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -608,6 +608,9 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) { visitor.visit_lifetime(lifetime); } TyImplTraitExistential(_, def_id, ref lifetimes) => { + // we are not recursing into the `existential` item, because it is already being visited + // as part of the surrounding module. The `NodeId` just exists so we don't have to look + // it up everywhere else in the compiler visitor.visit_def_mention(Def::Existential(def_id)); walk_list!(visitor, visit_lifetime, lifetimes); }