@@ -48,7 +48,7 @@ mod diagnostics;
48
48
/// Default type visitor (`TypeVisitor`) does most of the job, but it has some shortcomings.
49
49
/// First, it doesn't have overridable `fn visit_trait_ref`, so we have to catch trait def-ids
50
50
/// 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`.
52
52
trait DefIdVisitor < ' a , ' tcx : ' a > {
53
53
fn tcx ( & self ) -> TyCtxt < ' a , ' tcx , ' tcx > ;
54
54
fn shallow ( & self ) -> bool { false }
@@ -1579,10 +1579,15 @@ impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx>
1579
1579
// No subitems.
1580
1580
hir:: ItemKind :: GlobalAsm ( ..) => { }
1581
1581
// 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 ( ..) => {
1584
1584
self . check ( item. id , item_visibility) . generics ( ) . predicates ( ) . ty ( ) ;
1585
1585
}
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
+ }
1586
1591
hir:: ItemKind :: Trait ( .., ref trait_item_refs) => {
1587
1592
self . check ( item. id , item_visibility) . generics ( ) . predicates ( ) ;
1588
1593
0 commit comments