@@ -13,6 +13,7 @@ pub trait SpannedTypeVisitor<'tcx> {
13
13
fn visit ( & mut self , span : Span , value : impl TypeVisitable < TyCtxt < ' tcx > > ) -> Self :: Result ;
14
14
}
15
15
16
+ #[ instrument( level = "trace" , skip( tcx, visitor) ) ]
16
17
pub fn walk_types < ' tcx , V : SpannedTypeVisitor < ' tcx > > (
17
18
tcx : TyCtxt < ' tcx > ,
18
19
item : LocalDefId ,
@@ -36,7 +37,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
36
37
for ( hir, ty) in hir_sig. inputs . iter ( ) . zip ( ty_sig. inputs ( ) . iter ( ) ) {
37
38
try_visit ! ( visitor. visit( hir. span, ty. map_bound( |x| * x) ) ) ;
38
39
}
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) {
40
41
try_visit ! ( visitor. visit( span, pred) ) ;
41
42
}
42
43
}
@@ -54,7 +55,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
54
55
// Associated types in traits don't necessarily have a type that we can visit
55
56
try_visit ! ( visitor. visit( ty. span, tcx. type_of( item) . instantiate_identity( ) ) ) ;
56
57
}
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) {
58
59
try_visit ! ( visitor. visit( span, pred) ) ;
59
60
}
60
61
}
@@ -76,7 +77,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
76
77
let ty = field. ty ( tcx, args) ;
77
78
try_visit ! ( visitor. visit( span, ty) ) ;
78
79
}
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) {
80
81
try_visit ! ( visitor. visit( span, pred) ) ;
81
82
}
82
83
}
@@ -95,12 +96,12 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
95
96
_ => tcx. def_span ( item) ,
96
97
} ;
97
98
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) {
99
100
try_visit ! ( visitor. visit( span, pred) ) ;
100
101
}
101
102
}
102
103
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) {
104
105
try_visit ! ( visitor. visit( span, pred) ) ;
105
106
}
106
107
}
0 commit comments