@@ -573,6 +573,7 @@ fn get_new_lifetime_name<'tcx>(
573573
574574/// Returns the predicates defined on `item_def_id` of the form
575575/// `X: Foo` where `X` is the type parameter `def_id`.
576+ #[ instrument( level = "trace" , skip( tcx) ) ]
576577fn type_param_predicates (
577578 tcx : TyCtxt < ' _ > ,
578579 ( item_def_id, def_id, assoc_name) : ( DefId , LocalDefId , Ident ) ,
@@ -679,7 +680,7 @@ impl<'tcx> ItemCtxt<'tcx> {
679680 assoc_name : Option < Ident > ,
680681 ) -> Vec < ( ty:: Predicate < ' tcx > , Span ) > {
681682 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) ;
683684 ast_generics
684685 . predicates
685686 . iter ( )
@@ -708,9 +709,8 @@ impl<'tcx> ItemCtxt<'tcx> {
708709 . collect ( )
709710 }
710711
712+ #[ instrument( level = "trace" , skip( self ) ) ]
711713 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-
714714 match b {
715715 hir:: GenericBound :: Trait ( poly_trait_ref, _) => {
716716 let trait_ref = & poly_trait_ref. trait_ref ;
@@ -2105,11 +2105,10 @@ fn predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredicates<'_> {
21052105
21062106/// Returns a list of user-specified type predicates for the definition with ID `def_id`.
21072107/// N.B., this does not include any implied/inferred constraints.
2108+ #[ instrument( level = "trace" , skip( tcx) , ret) ]
21082109fn gather_explicit_predicates_of ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> ty:: GenericPredicates < ' _ > {
21092110 use rustc_hir:: * ;
21102111
2111- debug ! ( "explicit_predicates_of(def_id={:?})" , def_id) ;
2112-
21132112 let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
21142113 let node = tcx. hir ( ) . get ( hir_id) ;
21152114
@@ -2224,6 +2223,9 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
22242223 + has_own_self as u32
22252224 + early_bound_lifetimes_from_generics ( tcx, ast_generics) . count ( ) as u32 ;
22262225
2226+ trace ! ( ?predicates) ;
2227+ trace ! ( ?ast_generics) ;
2228+
22272229 // Collect the predicates that were written inline by the user on each
22282230 // type parameter (e.g., `<T: Foo>`).
22292231 for param in ast_generics. params {
@@ -2244,7 +2246,9 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
22442246 Some ( ( param. hir_id , ast_generics. predicates ) ) ,
22452247 param. span ,
22462248 ) ;
2249+ trace ! ( ?bounds) ;
22472250 predicates. extend ( bounds. predicates ( tcx, param_ty) ) ;
2251+ trace ! ( ?predicates) ;
22482252 }
22492253 GenericParamKind :: Const { .. } => {
22502254 // Bounds on const parameters are currently not possible.
@@ -2253,6 +2257,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
22532257 }
22542258 }
22552259
2260+ trace ! ( ?predicates) ;
22562261 // Add in the bounds that appear in the where-clause.
22572262 for predicate in ast_generics. predicates {
22582263 match predicate {
@@ -2338,12 +2343,10 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
23382343 ) ;
23392344 }
23402345
2341- let result = ty:: GenericPredicates {
2346+ ty:: GenericPredicates {
23422347 parent : generics. parent ,
23432348 predicates : tcx. arena . alloc_from_iter ( predicates) ,
2344- } ;
2345- debug ! ( "explicit_predicates_of(def_id={:?}) = {:?}" , def_id, result) ;
2346- result
2349+ }
23472350}
23482351
23492352fn const_evaluatable_predicates_of < ' tcx > (
0 commit comments