@@ -13,6 +13,7 @@ pub trait SpannedTypeVisitor<'tcx> {
1313 fn visit ( & mut self , span : Span , value : impl TypeVisitable < TyCtxt < ' tcx > > ) -> Self :: Result ;
1414}
1515
16+ #[ instrument( level = "trace" , skip( tcx, visitor) ) ]
1617pub fn walk_types < ' tcx , V : SpannedTypeVisitor < ' tcx > > (
1718 tcx : TyCtxt < ' tcx > ,
1819 item : LocalDefId ,
@@ -36,7 +37,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
3637 for ( hir, ty) in hir_sig. inputs . iter ( ) . zip ( ty_sig. inputs ( ) . iter ( ) ) {
3738 try_visit ! ( visitor. visit( hir. span, ty. map_bound( |x| * x) ) ) ;
3839 }
39- for ( pred, span) in tcx. predicates_of ( item) . instantiate_identity ( tcx) {
40+ for ( pred, span) in tcx. explicit_predicates_of ( item) . instantiate_identity ( tcx) {
4041 try_visit ! ( visitor. visit( span, pred) ) ;
4142 }
4243 }
@@ -54,7 +55,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
5455 // Associated types in traits don't necessarily have a type that we can visit
5556 try_visit ! ( visitor. visit( ty. span, tcx. type_of( item) . instantiate_identity( ) ) ) ;
5657 }
57- for ( pred, span) in tcx. predicates_of ( item) . instantiate_identity ( tcx) {
58+ for ( pred, span) in tcx. explicit_predicates_of ( item) . instantiate_identity ( tcx) {
5859 try_visit ! ( visitor. visit( span, pred) ) ;
5960 }
6061 }
@@ -76,7 +77,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
7677 let ty = field. ty ( tcx, args) ;
7778 try_visit ! ( visitor. visit( span, ty) ) ;
7879 }
79- for ( pred, span) in tcx. predicates_of ( item) . instantiate_identity ( tcx) {
80+ for ( pred, span) in tcx. explicit_predicates_of ( item) . instantiate_identity ( tcx) {
8081 try_visit ! ( visitor. visit( span, pred) ) ;
8182 }
8283 }
@@ -95,12 +96,12 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
9596 _ => tcx. def_span ( item) ,
9697 } ;
9798 try_visit ! ( visitor. visit( span, tcx. type_of( item) . instantiate_identity( ) ) ) ;
98- for ( pred, span) in tcx. predicates_of ( item) . instantiate_identity ( tcx) {
99+ for ( pred, span) in tcx. explicit_predicates_of ( item) . instantiate_identity ( tcx) {
99100 try_visit ! ( visitor. visit( span, pred) ) ;
100101 }
101102 }
102103 DefKind :: TraitAlias | DefKind :: Trait => {
103- for ( pred, span) in tcx. predicates_of ( item) . instantiate_identity ( tcx) {
104+ for ( pred, span) in tcx. explicit_predicates_of ( item) . instantiate_identity ( tcx) {
104105 try_visit ! ( visitor. visit( span, pred) ) ;
105106 }
106107 }
0 commit comments