]> git.lizzy.rs Git - rust.git/commitdiff
Explain the lack of item recursion
authorOliver Schneider <github35764891676564198441@oli-obk.de>
Wed, 27 Jun 2018 09:41:21 +0000 (11:41 +0200)
committerOliver Schneider <github35764891676564198441@oli-obk.de>
Wed, 27 Jun 2018 09:41:21 +0000 (11:41 +0200)
src/librustc/hir/intravisit.rs

index f2d1678d33692e12e8919d175af2faf73f87745c..e06563f90e0081129a0047bc1c9bcdb694c8d69f 100644 (file)
@@ -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);
         }