@@ -371,7 +371,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
371371
372372 let tcx = self . tcx ( ) ;
373373 let generics = tcx. generics_of ( def_id) ;
374- debug ! ( "generics: {:?}" , generics) ;
374+ debug ! ( ? generics) ;
375375
376376 if generics. has_self {
377377 if generics. parent . is_some ( ) {
@@ -643,17 +643,15 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
643643 assoc_bindings
644644 }
645645
646+ #[ instrument( level = "debug" , skip_all) ]
646647 pub fn lower_args_for_assoc_item (
647648 & self ,
648649 span : Span ,
649650 item_def_id : DefId ,
650651 item_segment : & hir:: PathSegment < ' tcx > ,
651652 parent_args : GenericArgsRef < ' tcx > ,
652653 ) -> GenericArgsRef < ' tcx > {
653- debug ! (
654- "create_args_for_associated_item(span: {:?}, item_def_id: {:?}, item_segment: {:?}" ,
655- span, item_def_id, item_segment
656- ) ;
654+ debug ! ( ?span, ?item_def_id, ?item_segment) ;
657655 let ( args, _) = self . lower_args_for_path (
658656 span,
659657 item_def_id,
@@ -984,24 +982,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
984982 ///
985983 /// `ty_param_def_id` is the `DefId` of the type parameter.
986984 /// This function will fail if there are no suitable bounds or there is any ambiguity.
987- #[ instrument( level = "debug" , skip ( self ) , ret) ]
985+ #[ instrument( level = "debug" , skip_all , ret) ]
988986 fn find_bound_for_assoc_item (
989987 & self ,
990988 ty_param_def_id : LocalDefId ,
991989 assoc_name : Ident ,
992990 span : Span ,
993991 ) -> Result < ty:: PolyTraitRef < ' tcx > , ErrorGuaranteed > {
992+ debug ! ( ?ty_param_def_id, ?assoc_name, ?span) ;
994993 let tcx = self . tcx ( ) ;
995994
996- debug ! (
997- "find_bound_for_assoc_item(ty_param_def_id={:?}, assoc_name={:?}, span={:?})" ,
998- ty_param_def_id, assoc_name, span,
999- ) ;
1000-
1001995 let predicates =
1002996 & self . get_type_parameter_bounds ( span, ty_param_def_id, assoc_name) . predicates ;
1003-
1004- debug ! ( "find_bound_for_assoc_item: predicates={:#?}" , predicates) ;
997+ debug ! ( "predicates={:#?}" , predicates) ;
1005998
1006999 let param_name = tcx. hir ( ) . ty_param_name ( ty_param_def_id) ;
10071000 self . one_bound_for_assoc_item (
@@ -1151,7 +1144,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
11511144 /// parameter or `Self`.
11521145 // NOTE: When this function starts resolving `Trait::AssocTy` successfully
11531146 // it should also start reporting the `BARE_TRAIT_OBJECTS` lint.
1154- #[ instrument( level = "debug" , skip ( self , hir_ref_id , span , qself , assoc_segment ) , fields ( assoc_ident=?assoc_segment . ident ) , ret) ]
1147+ #[ instrument( level = "debug" , skip_all , ret) ]
11551148 pub fn lower_assoc_path_to_ty (
11561149 & self ,
11571150 hir_ref_id : hir:: HirId ,
@@ -1161,7 +1154,9 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
11611154 assoc_segment : & hir:: PathSegment < ' tcx > ,
11621155 permit_variants : bool ,
11631156 ) -> Result < ( Ty < ' tcx > , DefKind , DefId ) , ErrorGuaranteed > {
1157+ debug ! ( %qself_ty, ?assoc_segment. ident) ;
11641158 let tcx = self . tcx ( ) ;
1159+
11651160 let assoc_ident = assoc_segment. ident ;
11661161 let qself_res = if let hir:: TyKind :: Path ( hir:: QPath :: Resolved ( _, path) ) = & qself. kind {
11671162 path. res
@@ -1704,6 +1699,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17041699 . collect ( )
17051700 }
17061701
1702+ #[ instrument( level = "debug" , skip_all) ]
17071703 fn lower_qpath_to_ty (
17081704 & self ,
17091705 span : Span ,
@@ -1716,22 +1712,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17161712 let tcx = self . tcx ( ) ;
17171713
17181714 let trait_def_id = tcx. parent ( item_def_id) ;
1719-
1720- debug ! ( "qpath_to_ty: trait_def_id={:?}" , trait_def_id) ;
1715+ debug ! ( ?trait_def_id) ;
17211716
17221717 let Some ( self_ty) = opt_self_ty else {
17231718 let path_str = tcx. def_path_str ( trait_def_id) ;
17241719
17251720 let def_id = self . item_def_id ( ) ;
1726-
1727- debug ! ( "qpath_to_ty: self.item_def_id()={:?}" , def_id) ;
1721+ debug ! ( item_def_id = ?def_id) ;
17281722
17291723 let parent_def_id = def_id
17301724 . as_local ( )
17311725 . map ( |def_id| tcx. local_def_id_to_hir_id ( def_id) )
17321726 . map ( |hir_id| tcx. hir ( ) . get_parent_item ( hir_id) . to_def_id ( ) ) ;
1733-
1734- debug ! ( "qpath_to_ty: parent_def_id={:?}" , parent_def_id) ;
1727+ debug ! ( ?parent_def_id) ;
17351728
17361729 // If the trait in segment is the same as the trait defining the item,
17371730 // use the `<Self as ..>` syntax in the error.
@@ -1766,8 +1759,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17661759 ) ;
17671760 return Ty :: new_error ( tcx, reported) ;
17681761 } ;
1769-
1770- debug ! ( "qpath_to_ty: self_type={:?}" , self_ty) ;
1762+ debug ! ( ?self_ty) ;
17711763
17721764 let trait_ref = self . lower_path_to_mono_trait_ref (
17731765 span,
@@ -1777,12 +1769,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17771769 false ,
17781770 constness,
17791771 ) ;
1772+ debug ! ( ?trait_ref) ;
17801773
17811774 let item_args =
17821775 self . lower_args_for_assoc_item ( span, item_def_id, item_segment, trait_ref. args ) ;
17831776
1784- debug ! ( "qpath_to_ty: trait_ref={:?}" , trait_ref) ;
1785-
17861777 Ty :: new_projection ( tcx, item_def_id, item_args)
17871778 }
17881779
@@ -2025,20 +2016,17 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
20252016 }
20262017
20272018 /// Check a type `Path` and lower it to a `Ty`.
2019+ #[ instrument( level = "debug" , skip_all) ]
20282020 pub fn lower_res_to_ty (
20292021 & self ,
20302022 opt_self_ty : Option < Ty < ' tcx > > ,
20312023 path : & hir:: Path < ' tcx > ,
20322024 hir_id : hir:: HirId ,
20332025 permit_variants : bool ,
20342026 ) -> Ty < ' tcx > {
2027+ debug ! ( ?path. res, ?opt_self_ty, ?path. segments) ;
20352028 let tcx = self . tcx ( ) ;
20362029
2037- debug ! (
2038- "res_to_ty(res={:?}, opt_self_ty={:?}, path_segments={:?})" ,
2039- path. res, opt_self_ty, path. segments
2040- ) ;
2041-
20422030 let span = path. span ;
20432031 match path. res {
20442032 Res :: Def ( DefKind :: OpaqueTy , did) => {
@@ -2572,19 +2560,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
25722560 result_ty
25732561 }
25742562
2575- #[ instrument( level = "debug" , skip ( self ) , ret) ]
2563+ #[ instrument( level = "debug" , skip_all , ret) ]
25762564 fn lower_impl_trait_ty (
25772565 & self ,
25782566 def_id : DefId ,
25792567 lifetimes : & [ hir:: GenericArg < ' _ > ] ,
25802568 in_trait : bool ,
25812569 ) -> Ty < ' tcx > {
2582- debug ! ( "impl_trait_ty_to_ty(def_id={:?}, lifetimes={:?})" , def_id, lifetimes) ;
2570+ debug ! ( ? def_id, ? lifetimes) ;
25832571 let tcx = self . tcx ( ) ;
25842572
25852573 let generics = tcx. generics_of ( def_id) ;
2574+ debug ! ( ?generics) ;
25862575
2587- debug ! ( "impl_trait_ty_to_ty: generics={:?}" , generics) ;
25882576 let args = ty:: GenericArgs :: for_item ( tcx, def_id, |param, _| {
25892577 // We use `generics.count() - lifetimes.len()` here instead of `generics.parent_count`
25902578 // since return-position impl trait in trait squashes all of the generics from its source fn
@@ -2610,7 +2598,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
26102598 tcx. mk_param_from_def ( param)
26112599 }
26122600 } ) ;
2613- debug ! ( "impl_trait_ty_to_ty: args={:?}" , args) ;
2601+ debug ! ( ? args) ;
26142602
26152603 if in_trait {
26162604 Ty :: new_projection ( tcx, def_id, args)
0 commit comments