@@ -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
@@ -1705,6 +1700,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17051700 . collect ( )
17061701 }
17071702
1703+ #[ instrument( level = "debug" , skip_all) ]
17081704 fn lower_qpath_to_ty (
17091705 & self ,
17101706 span : Span ,
@@ -1717,22 +1713,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17171713 let tcx = self . tcx ( ) ;
17181714
17191715 let trait_def_id = tcx. parent ( item_def_id) ;
1720-
1721- debug ! ( "qpath_to_ty: trait_def_id={:?}" , trait_def_id) ;
1716+ debug ! ( ?trait_def_id) ;
17221717
17231718 let Some ( self_ty) = opt_self_ty else {
17241719 let path_str = tcx. def_path_str ( trait_def_id) ;
17251720
17261721 let def_id = self . item_def_id ( ) ;
1727-
1728- debug ! ( "qpath_to_ty: self.item_def_id()={:?}" , def_id) ;
1722+ debug ! ( item_def_id = ?def_id) ;
17291723
17301724 let parent_def_id = def_id
17311725 . as_local ( )
17321726 . map ( |def_id| tcx. local_def_id_to_hir_id ( def_id) )
17331727 . map ( |hir_id| tcx. hir ( ) . get_parent_item ( hir_id) . to_def_id ( ) ) ;
1734-
1735- debug ! ( "qpath_to_ty: parent_def_id={:?}" , parent_def_id) ;
1728+ debug ! ( ?parent_def_id) ;
17361729
17371730 // If the trait in segment is the same as the trait defining the item,
17381731 // use the `<Self as ..>` syntax in the error.
@@ -1767,8 +1760,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17671760 ) ;
17681761 return Ty :: new_error ( tcx, reported) ;
17691762 } ;
1770-
1771- debug ! ( "qpath_to_ty: self_type={:?}" , self_ty) ;
1763+ debug ! ( ?self_ty) ;
17721764
17731765 let trait_ref = self . lower_path_to_mono_trait_ref (
17741766 span,
@@ -1778,12 +1770,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
17781770 false ,
17791771 constness,
17801772 ) ;
1773+ debug ! ( ?trait_ref) ;
17811774
17821775 let item_args =
17831776 self . lower_args_for_assoc_item ( span, item_def_id, item_segment, trait_ref. args ) ;
17841777
1785- debug ! ( "qpath_to_ty: trait_ref={:?}" , trait_ref) ;
1786-
17871778 Ty :: new_projection ( tcx, item_def_id, item_args)
17881779 }
17891780
@@ -2026,20 +2017,17 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
20262017 }
20272018
20282019 /// Check a type `Path` and lower it to a `Ty`.
2020+ #[ instrument( level = "debug" , skip_all) ]
20292021 pub fn lower_res_to_ty (
20302022 & self ,
20312023 opt_self_ty : Option < Ty < ' tcx > > ,
20322024 path : & hir:: Path < ' tcx > ,
20332025 hir_id : hir:: HirId ,
20342026 permit_variants : bool ,
20352027 ) -> Ty < ' tcx > {
2028+ debug ! ( ?path. res, ?opt_self_ty, ?path. segments) ;
20362029 let tcx = self . tcx ( ) ;
20372030
2038- debug ! (
2039- "res_to_ty(res={:?}, opt_self_ty={:?}, path_segments={:?})" ,
2040- path. res, opt_self_ty, path. segments
2041- ) ;
2042-
20432031 let span = path. span ;
20442032 match path. res {
20452033 Res :: Def ( DefKind :: OpaqueTy , did) => {
@@ -2560,19 +2548,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
25602548 result_ty
25612549 }
25622550
2563- #[ instrument( level = "debug" , skip ( self ) , ret) ]
2551+ #[ instrument( level = "debug" , skip_all , ret) ]
25642552 fn lower_impl_trait_ty (
25652553 & self ,
25662554 def_id : DefId ,
25672555 lifetimes : & [ hir:: GenericArg < ' _ > ] ,
25682556 in_trait : bool ,
25692557 ) -> Ty < ' tcx > {
2570- debug ! ( "impl_trait_ty_to_ty(def_id={:?}, lifetimes={:?})" , def_id, lifetimes) ;
2558+ debug ! ( ? def_id, ? lifetimes) ;
25712559 let tcx = self . tcx ( ) ;
25722560
25732561 let generics = tcx. generics_of ( def_id) ;
2562+ debug ! ( ?generics) ;
25742563
2575- debug ! ( "impl_trait_ty_to_ty: generics={:?}" , generics) ;
25762564 let args = ty:: GenericArgs :: for_item ( tcx, def_id, |param, _| {
25772565 // We use `generics.count() - lifetimes.len()` here instead of `generics.parent_count`
25782566 // since return-position impl trait in trait squashes all of the generics from its source fn
@@ -2598,7 +2586,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
25982586 tcx. mk_param_from_def ( param)
25992587 }
26002588 } ) ;
2601- debug ! ( "impl_trait_ty_to_ty: args={:?}" , args) ;
2589+ debug ! ( ? args) ;
26022590
26032591 if in_trait {
26042592 Ty :: new_projection ( tcx, def_id, args)
0 commit comments