@@ -369,7 +369,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
369369
370370 let tcx = self . tcx ( ) ;
371371 let generics = tcx. generics_of ( def_id) ;
372- debug ! ( "generics: {:?}" , generics) ;
372+ debug ! ( ? generics) ;
373373
374374 if generics. has_self {
375375 if generics. parent . is_some ( ) {
@@ -641,17 +641,14 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
641641 assoc_bindings
642642 }
643643
644+ #[ instrument( level = "debug" , skip( self , parent_args) , ret) ]
644645 pub fn lower_args_for_assoc_item (
645646 & self ,
646647 span : Span ,
647648 item_def_id : DefId ,
648649 item_segment : & hir:: PathSegment < ' tcx > ,
649650 parent_args : GenericArgsRef < ' tcx > ,
650651 ) -> GenericArgsRef < ' tcx > {
651- debug ! (
652- "create_args_for_associated_item(span: {:?}, item_def_id: {:?}, item_segment: {:?}" ,
653- span, item_def_id, item_segment
654- ) ;
655652 let ( args, _) = self . lower_args_for_path (
656653 span,
657654 item_def_id,
@@ -991,15 +988,9 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
991988 ) -> Result < ty:: PolyTraitRef < ' tcx > , ErrorGuaranteed > {
992989 let tcx = self . tcx ( ) ;
993990
994- debug ! (
995- "find_bound_for_assoc_item(ty_param_def_id={:?}, assoc_name={:?}, span={:?})" ,
996- ty_param_def_id, assoc_name, span,
997- ) ;
998-
999991 let predicates =
1000992 & self . get_type_parameter_bounds ( span, ty_param_def_id, assoc_name) . predicates ;
1001-
1002- debug ! ( "find_bound_for_assoc_item: predicates={:#?}" , predicates) ;
993+ debug ! ( ?predicates) ;
1003994
1004995 let param_name = tcx. hir ( ) . ty_param_name ( ty_param_def_id) ;
1005996 self . one_bound_for_assoc_item (
@@ -1149,7 +1140,6 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
11491140 /// parameter or `Self`.
11501141 // NOTE: When this function starts resolving `Trait::AssocTy` successfully
11511142 // it should also start reporting the `BARE_TRAIT_OBJECTS` lint.
1152- #[ instrument( level = "debug" , skip( self , hir_ref_id, span, qself, assoc_segment) , fields( assoc_ident=?assoc_segment. ident) , ret) ]
11531143 pub fn lower_assoc_path_to_ty (
11541144 & self ,
11551145 hir_ref_id : hir:: HirId ,
@@ -1159,7 +1149,10 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
11591149 assoc_segment : & hir:: PathSegment < ' tcx > ,
11601150 permit_variants : bool ,
11611151 ) -> Result < ( Ty < ' tcx > , DefKind , DefId ) , ErrorGuaranteed > {
1152+ let _guard = tracing:: debug_span!( "lower_assoc_path_to_ty" ) . entered ( ) ;
1153+ debug ! ( %qself_ty, ?assoc_segment. ident) ;
11621154 let tcx = self . tcx ( ) ;
1155+
11631156 let assoc_ident = assoc_segment. ident ;
11641157 let qself_res = if let hir:: TyKind :: Path ( hir:: QPath :: Resolved ( _, path) ) = & qself. kind {
11651158 path. res
@@ -1712,25 +1705,23 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17121705 item_segment : & hir:: PathSegment < ' tcx > ,
17131706 constness : ty:: BoundConstness ,
17141707 ) -> Ty < ' tcx > {
1708+ let _guard = tracing:: debug_span!( "lower_qpath_to_ty" ) . entered ( ) ;
17151709 let tcx = self . tcx ( ) ;
17161710
17171711 let trait_def_id = tcx. parent ( item_def_id) ;
1718-
1719- debug ! ( "qpath_to_ty: trait_def_id={:?}" , trait_def_id) ;
1712+ debug ! ( ?trait_def_id) ;
17201713
17211714 let Some ( self_ty) = opt_self_ty else {
17221715 let path_str = tcx. def_path_str ( trait_def_id) ;
17231716
17241717 let def_id = self . item_def_id ( ) ;
1725-
1726- debug ! ( "qpath_to_ty: self.item_def_id()={:?}" , def_id) ;
1718+ debug ! ( item_def_id = ?def_id) ;
17271719
17281720 let parent_def_id = def_id
17291721 . as_local ( )
17301722 . map ( |def_id| tcx. local_def_id_to_hir_id ( def_id) )
17311723 . map ( |hir_id| tcx. hir ( ) . get_parent_item ( hir_id) . to_def_id ( ) ) ;
1732-
1733- debug ! ( "qpath_to_ty: parent_def_id={:?}" , parent_def_id) ;
1724+ debug ! ( ?parent_def_id) ;
17341725
17351726 // If the trait in segment is the same as the trait defining the item,
17361727 // use the `<Self as ..>` syntax in the error.
@@ -1765,8 +1756,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17651756 ) ;
17661757 return Ty :: new_error ( tcx, reported) ;
17671758 } ;
1768-
1769- debug ! ( "qpath_to_ty: self_type={:?}" , self_ty) ;
1759+ debug ! ( ?self_ty) ;
17701760
17711761 let trait_ref = self . lower_path_to_mono_trait_ref (
17721762 span,
@@ -1776,12 +1766,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17761766 false ,
17771767 constness,
17781768 ) ;
1769+ debug ! ( ?trait_ref) ;
17791770
17801771 let item_args =
17811772 self . lower_args_for_assoc_item ( span, item_def_id, item_segment, trait_ref. args ) ;
17821773
1783- debug ! ( "qpath_to_ty: trait_ref={:?}" , trait_ref) ;
1784-
17851774 Ty :: new_projection ( tcx, item_def_id, item_args)
17861775 }
17871776
@@ -2031,13 +2020,10 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
20312020 hir_id : hir:: HirId ,
20322021 permit_variants : bool ,
20332022 ) -> Ty < ' tcx > {
2023+ let _guard = tracing:: debug_span!( "lower_res_to_ty" ) . entered ( ) ;
2024+ debug ! ( ?path. res, ?opt_self_ty, ?path. segments) ;
20342025 let tcx = self . tcx ( ) ;
20352026
2036- debug ! (
2037- "res_to_ty(res={:?}, opt_self_ty={:?}, path_segments={:?})" ,
2038- path. res, opt_self_ty, path. segments
2039- ) ;
2040-
20412027 let span = path. span ;
20422028 match path. res {
20432029 Res :: Def ( DefKind :: OpaqueTy , did) => {
@@ -2565,12 +2551,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
25652551 lifetimes : & [ hir:: GenericArg < ' _ > ] ,
25662552 in_trait : bool ,
25672553 ) -> Ty < ' tcx > {
2568- debug ! ( "impl_trait_ty_to_ty(def_id={:?}, lifetimes={:?})" , def_id, lifetimes) ;
25692554 let tcx = self . tcx ( ) ;
25702555
25712556 let generics = tcx. generics_of ( def_id) ;
2557+ debug ! ( ?generics) ;
25722558
2573- debug ! ( "impl_trait_ty_to_ty: generics={:?}" , generics) ;
25742559 let args = ty:: GenericArgs :: for_item ( tcx, def_id, |param, _| {
25752560 // We use `generics.count() - lifetimes.len()` here instead of `generics.parent_count`
25762561 // since return-position impl trait in trait squashes all of the generics from its source fn
@@ -2596,7 +2581,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
25962581 tcx. mk_param_from_def ( param)
25972582 }
25982583 } ) ;
2599- debug ! ( "impl_trait_ty_to_ty: args={:?}" , args) ;
2584+ debug ! ( ? args) ;
26002585
26012586 if in_trait {
26022587 Ty :: new_projection ( tcx, def_id, args)
0 commit comments