@@ -369,7 +369,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
369
369
370
370
let tcx = self . tcx ( ) ;
371
371
let generics = tcx. generics_of ( def_id) ;
372
- debug ! ( "generics: {:?}" , generics) ;
372
+ debug ! ( ? generics) ;
373
373
374
374
if generics. has_self {
375
375
if generics. parent . is_some ( ) {
@@ -641,17 +641,14 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
641
641
assoc_bindings
642
642
}
643
643
644
+ #[ instrument( level = "debug" , skip( self , parent_args) , ret) ]
644
645
pub fn lower_args_for_assoc_item (
645
646
& self ,
646
647
span : Span ,
647
648
item_def_id : DefId ,
648
649
item_segment : & hir:: PathSegment < ' tcx > ,
649
650
parent_args : GenericArgsRef < ' tcx > ,
650
651
) -> GenericArgsRef < ' tcx > {
651
- debug ! (
652
- "create_args_for_associated_item(span: {:?}, item_def_id: {:?}, item_segment: {:?}" ,
653
- span, item_def_id, item_segment
654
- ) ;
655
652
let ( args, _) = self . lower_args_for_path (
656
653
span,
657
654
item_def_id,
@@ -991,15 +988,9 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
991
988
) -> Result < ty:: PolyTraitRef < ' tcx > , ErrorGuaranteed > {
992
989
let tcx = self . tcx ( ) ;
993
990
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
-
999
991
let predicates =
1000
992
& 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) ;
1003
994
1004
995
let param_name = tcx. hir ( ) . ty_param_name ( ty_param_def_id) ;
1005
996
self . one_bound_for_assoc_item (
@@ -1149,7 +1140,6 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1149
1140
/// parameter or `Self`.
1150
1141
// NOTE: When this function starts resolving `Trait::AssocTy` successfully
1151
1142
// 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) ]
1153
1143
pub fn lower_assoc_path_to_ty (
1154
1144
& self ,
1155
1145
hir_ref_id : hir:: HirId ,
@@ -1159,7 +1149,10 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1159
1149
assoc_segment : & hir:: PathSegment < ' tcx > ,
1160
1150
permit_variants : bool ,
1161
1151
) -> 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) ;
1162
1154
let tcx = self . tcx ( ) ;
1155
+
1163
1156
let assoc_ident = assoc_segment. ident ;
1164
1157
let qself_res = if let hir:: TyKind :: Path ( hir:: QPath :: Resolved ( _, path) ) = & qself. kind {
1165
1158
path. res
@@ -1712,25 +1705,23 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1712
1705
item_segment : & hir:: PathSegment < ' tcx > ,
1713
1706
constness : ty:: BoundConstness ,
1714
1707
) -> Ty < ' tcx > {
1708
+ let _guard = tracing:: debug_span!( "lower_qpath_to_ty" ) . entered ( ) ;
1715
1709
let tcx = self . tcx ( ) ;
1716
1710
1717
1711
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) ;
1720
1713
1721
1714
let Some ( self_ty) = opt_self_ty else {
1722
1715
let path_str = tcx. def_path_str ( trait_def_id) ;
1723
1716
1724
1717
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) ;
1727
1719
1728
1720
let parent_def_id = def_id
1729
1721
. as_local ( )
1730
1722
. map ( |def_id| tcx. local_def_id_to_hir_id ( def_id) )
1731
1723
. 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) ;
1734
1725
1735
1726
// If the trait in segment is the same as the trait defining the item,
1736
1727
// use the `<Self as ..>` syntax in the error.
@@ -1765,8 +1756,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1765
1756
) ;
1766
1757
return Ty :: new_error ( tcx, reported) ;
1767
1758
} ;
1768
-
1769
- debug ! ( "qpath_to_ty: self_type={:?}" , self_ty) ;
1759
+ debug ! ( ?self_ty) ;
1770
1760
1771
1761
let trait_ref = self . lower_path_to_mono_trait_ref (
1772
1762
span,
@@ -1776,12 +1766,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1776
1766
false ,
1777
1767
constness,
1778
1768
) ;
1769
+ debug ! ( ?trait_ref) ;
1779
1770
1780
1771
let item_args =
1781
1772
self . lower_args_for_assoc_item ( span, item_def_id, item_segment, trait_ref. args ) ;
1782
1773
1783
- debug ! ( "qpath_to_ty: trait_ref={:?}" , trait_ref) ;
1784
-
1785
1774
Ty :: new_projection ( tcx, item_def_id, item_args)
1786
1775
}
1787
1776
@@ -2031,13 +2020,10 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
2031
2020
hir_id : hir:: HirId ,
2032
2021
permit_variants : bool ,
2033
2022
) -> Ty < ' tcx > {
2023
+ let _guard = tracing:: debug_span!( "lower_res_to_ty" ) . entered ( ) ;
2024
+ debug ! ( ?path. res, ?opt_self_ty, ?path. segments) ;
2034
2025
let tcx = self . tcx ( ) ;
2035
2026
2036
- debug ! (
2037
- "res_to_ty(res={:?}, opt_self_ty={:?}, path_segments={:?})" ,
2038
- path. res, opt_self_ty, path. segments
2039
- ) ;
2040
-
2041
2027
let span = path. span ;
2042
2028
match path. res {
2043
2029
Res :: Def ( DefKind :: OpaqueTy , did) => {
@@ -2565,12 +2551,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
2565
2551
lifetimes : & [ hir:: GenericArg < ' _ > ] ,
2566
2552
in_trait : bool ,
2567
2553
) -> Ty < ' tcx > {
2568
- debug ! ( "impl_trait_ty_to_ty(def_id={:?}, lifetimes={:?})" , def_id, lifetimes) ;
2569
2554
let tcx = self . tcx ( ) ;
2570
2555
2571
2556
let generics = tcx. generics_of ( def_id) ;
2557
+ debug ! ( ?generics) ;
2572
2558
2573
- debug ! ( "impl_trait_ty_to_ty: generics={:?}" , generics) ;
2574
2559
let args = ty:: GenericArgs :: for_item ( tcx, def_id, |param, _| {
2575
2560
// We use `generics.count() - lifetimes.len()` here instead of `generics.parent_count`
2576
2561
// 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 {
2596
2581
tcx. mk_param_from_def ( param)
2597
2582
}
2598
2583
} ) ;
2599
- debug ! ( "impl_trait_ty_to_ty: args={:?}" , args) ;
2584
+ debug ! ( ? args) ;
2600
2585
2601
2586
if in_trait {
2602
2587
Ty :: new_projection ( tcx, def_id, args)
0 commit comments