@@ -573,6 +573,7 @@ fn get_new_lifetime_name<'tcx>(
573
573
574
574
/// Returns the predicates defined on `item_def_id` of the form
575
575
/// `X: Foo` where `X` is the type parameter `def_id`.
576
+ #[ instrument( level = "trace" , skip( tcx) ) ]
576
577
fn type_param_predicates (
577
578
tcx : TyCtxt < ' _ > ,
578
579
( item_def_id, def_id, assoc_name) : ( DefId , LocalDefId , Ident ) ,
@@ -679,7 +680,7 @@ impl<'tcx> ItemCtxt<'tcx> {
679
680
assoc_name : Option < Ident > ,
680
681
) -> Vec < ( ty:: Predicate < ' tcx > , Span ) > {
681
682
let param_def_id = self . tcx . hir ( ) . local_def_id ( param_id) . to_def_id ( ) ;
682
- debug ! ( ?param_def_id) ;
683
+ trace ! ( ?param_def_id) ;
683
684
ast_generics
684
685
. predicates
685
686
. iter ( )
@@ -708,9 +709,8 @@ impl<'tcx> ItemCtxt<'tcx> {
708
709
. collect ( )
709
710
}
710
711
712
+ #[ instrument( level = "trace" , skip( self ) ) ]
711
713
fn bound_defines_assoc_item ( & self , b : & hir:: GenericBound < ' _ > , assoc_name : Ident ) -> bool {
712
- debug ! ( "bound_defines_assoc_item(b={:?}, assoc_name={:?})" , b, assoc_name) ;
713
-
714
714
match b {
715
715
hir:: GenericBound :: Trait ( poly_trait_ref, _) => {
716
716
let trait_ref = & poly_trait_ref. trait_ref ;
@@ -2105,11 +2105,10 @@ fn predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredicates<'_> {
2105
2105
2106
2106
/// Returns a list of user-specified type predicates for the definition with ID `def_id`.
2107
2107
/// N.B., this does not include any implied/inferred constraints.
2108
+ #[ instrument( level = "trace" , skip( tcx) , ret) ]
2108
2109
fn gather_explicit_predicates_of ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> ty:: GenericPredicates < ' _ > {
2109
2110
use rustc_hir:: * ;
2110
2111
2111
- debug ! ( "explicit_predicates_of(def_id={:?})" , def_id) ;
2112
-
2113
2112
let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
2114
2113
let node = tcx. hir ( ) . get ( hir_id) ;
2115
2114
@@ -2224,6 +2223,9 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
2224
2223
+ has_own_self as u32
2225
2224
+ early_bound_lifetimes_from_generics ( tcx, ast_generics) . count ( ) as u32 ;
2226
2225
2226
+ trace ! ( ?predicates) ;
2227
+ trace ! ( ?ast_generics) ;
2228
+
2227
2229
// Collect the predicates that were written inline by the user on each
2228
2230
// type parameter (e.g., `<T: Foo>`).
2229
2231
for param in ast_generics. params {
@@ -2244,7 +2246,9 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
2244
2246
Some ( ( param. hir_id , ast_generics. predicates ) ) ,
2245
2247
param. span ,
2246
2248
) ;
2249
+ trace ! ( ?bounds) ;
2247
2250
predicates. extend ( bounds. predicates ( tcx, param_ty) ) ;
2251
+ trace ! ( ?predicates) ;
2248
2252
}
2249
2253
GenericParamKind :: Const { .. } => {
2250
2254
// Bounds on const parameters are currently not possible.
@@ -2253,6 +2257,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
2253
2257
}
2254
2258
}
2255
2259
2260
+ trace ! ( ?predicates) ;
2256
2261
// Add in the bounds that appear in the where-clause.
2257
2262
for predicate in ast_generics. predicates {
2258
2263
match predicate {
@@ -2338,12 +2343,10 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
2338
2343
) ;
2339
2344
}
2340
2345
2341
- let result = ty:: GenericPredicates {
2346
+ ty:: GenericPredicates {
2342
2347
parent : generics. parent ,
2343
2348
predicates : tcx. arena . alloc_from_iter ( predicates) ,
2344
- } ;
2345
- debug ! ( "explicit_predicates_of(def_id={:?}) = {:?}" , def_id, result) ;
2346
- result
2349
+ }
2347
2350
}
2348
2351
2349
2352
fn const_evaluatable_predicates_of < ' tcx > (
0 commit comments