@@ -48,7 +48,7 @@ mod diagnostics;
4848/// Default type visitor (`TypeVisitor`) does most of the job, but it has some shortcomings.
4949/// First, it doesn't have overridable `fn visit_trait_ref`, so we have to catch trait def-ids
5050/// manually. Second, it doesn't visit some type components like signatures of fn types, or traits
51- /// in `impl Trait`, see individual commits in `DefIdVisitorSkeleton::visit_ty`.
51+ /// in `impl Trait`, see individual comments in `DefIdVisitorSkeleton::visit_ty`.
5252trait DefIdVisitor < ' a , ' tcx : ' a > {
5353 fn tcx ( & self ) -> TyCtxt < ' a , ' tcx , ' tcx > ;
5454 fn shallow ( & self ) -> bool { false }
@@ -1579,10 +1579,15 @@ impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx>
15791579 // No subitems.
15801580 hir:: ItemKind :: GlobalAsm ( ..) => { }
15811581 // Subitems of these items have inherited publicity.
1582- hir:: ItemKind :: Const ( ..) | hir:: ItemKind :: Static ( ..) | hir :: ItemKind :: Fn ( .. ) |
1583- hir:: ItemKind :: Existential ( ..) | hir:: ItemKind :: Ty ( ..) => {
1582+ hir:: ItemKind :: Const ( ..) | hir:: ItemKind :: Static ( ..) |
1583+ hir:: ItemKind :: Fn ( ..) | hir:: ItemKind :: Ty ( ..) => {
15841584 self . check ( item. id , item_visibility) . generics ( ) . predicates ( ) . ty ( ) ;
15851585 }
1586+ hir:: ItemKind :: Existential ( ..) => {
1587+ // `ty()` for existential types is the underlying type,
1588+ // it's not a part of interface, so we skip it.
1589+ self . check ( item. id , item_visibility) . generics ( ) . predicates ( ) ;
1590+ }
15861591 hir:: ItemKind :: Trait ( .., ref trait_item_refs) => {
15871592 self . check ( item. id , item_visibility) . generics ( ) . predicates ( ) ;
15881593
0 commit comments