@@ -371,7 +371,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
371
371
372
372
let tcx = self . tcx ( ) ;
373
373
let generics = tcx. generics_of ( def_id) ;
374
- debug ! ( "generics: {:?}" , generics) ;
374
+ debug ! ( ? generics) ;
375
375
376
376
if generics. has_self {
377
377
if generics. parent . is_some ( ) {
@@ -643,17 +643,15 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
643
643
assoc_bindings
644
644
}
645
645
646
+ #[ instrument( level = "debug" , skip_all) ]
646
647
pub fn lower_args_for_assoc_item (
647
648
& self ,
648
649
span : Span ,
649
650
item_def_id : DefId ,
650
651
item_segment : & hir:: PathSegment < ' tcx > ,
651
652
parent_args : GenericArgsRef < ' tcx > ,
652
653
) -> 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) ;
657
655
let ( args, _) = self . lower_args_for_path (
658
656
span,
659
657
item_def_id,
@@ -984,24 +982,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
984
982
///
985
983
/// `ty_param_def_id` is the `DefId` of the type parameter.
986
984
/// 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) ]
988
986
fn find_bound_for_assoc_item (
989
987
& self ,
990
988
ty_param_def_id : LocalDefId ,
991
989
assoc_name : Ident ,
992
990
span : Span ,
993
991
) -> Result < ty:: PolyTraitRef < ' tcx > , ErrorGuaranteed > {
992
+ debug ! ( ?ty_param_def_id, ?assoc_name, ?span) ;
994
993
let tcx = self . tcx ( ) ;
995
994
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
-
1001
995
let predicates =
1002
996
& 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) ;
1005
998
1006
999
let param_name = tcx. hir ( ) . ty_param_name ( ty_param_def_id) ;
1007
1000
self . one_bound_for_assoc_item (
@@ -1151,7 +1144,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1151
1144
/// parameter or `Self`.
1152
1145
// NOTE: When this function starts resolving `Trait::AssocTy` successfully
1153
1146
// 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) ]
1155
1148
pub fn lower_assoc_path_to_ty (
1156
1149
& self ,
1157
1150
hir_ref_id : hir:: HirId ,
@@ -1161,7 +1154,9 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1161
1154
assoc_segment : & hir:: PathSegment < ' tcx > ,
1162
1155
permit_variants : bool ,
1163
1156
) -> Result < ( Ty < ' tcx > , DefKind , DefId ) , ErrorGuaranteed > {
1157
+ debug ! ( %qself_ty, ?assoc_segment. ident) ;
1164
1158
let tcx = self . tcx ( ) ;
1159
+
1165
1160
let assoc_ident = assoc_segment. ident ;
1166
1161
let qself_res = if let hir:: TyKind :: Path ( hir:: QPath :: Resolved ( _, path) ) = & qself. kind {
1167
1162
path. res
@@ -1705,6 +1700,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1705
1700
. collect ( )
1706
1701
}
1707
1702
1703
+ #[ instrument( level = "debug" , skip_all) ]
1708
1704
fn lower_qpath_to_ty (
1709
1705
& self ,
1710
1706
span : Span ,
@@ -1717,22 +1713,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1717
1713
let tcx = self . tcx ( ) ;
1718
1714
1719
1715
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) ;
1722
1717
1723
1718
let Some ( self_ty) = opt_self_ty else {
1724
1719
let path_str = tcx. def_path_str ( trait_def_id) ;
1725
1720
1726
1721
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) ;
1729
1723
1730
1724
let parent_def_id = def_id
1731
1725
. as_local ( )
1732
1726
. map ( |def_id| tcx. local_def_id_to_hir_id ( def_id) )
1733
1727
. 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) ;
1736
1729
1737
1730
// If the trait in segment is the same as the trait defining the item,
1738
1731
// use the `<Self as ..>` syntax in the error.
@@ -1767,8 +1760,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1767
1760
) ;
1768
1761
return Ty :: new_error ( tcx, reported) ;
1769
1762
} ;
1770
-
1771
- debug ! ( "qpath_to_ty: self_type={:?}" , self_ty) ;
1763
+ debug ! ( ?self_ty) ;
1772
1764
1773
1765
let trait_ref = self . lower_path_to_mono_trait_ref (
1774
1766
span,
@@ -1778,12 +1770,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1778
1770
false ,
1779
1771
constness,
1780
1772
) ;
1773
+ debug ! ( ?trait_ref) ;
1781
1774
1782
1775
let item_args =
1783
1776
self . lower_args_for_assoc_item ( span, item_def_id, item_segment, trait_ref. args ) ;
1784
1777
1785
- debug ! ( "qpath_to_ty: trait_ref={:?}" , trait_ref) ;
1786
-
1787
1778
Ty :: new_projection ( tcx, item_def_id, item_args)
1788
1779
}
1789
1780
@@ -2026,20 +2017,17 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
2026
2017
}
2027
2018
2028
2019
/// Check a type `Path` and lower it to a `Ty`.
2020
+ #[ instrument( level = "debug" , skip_all) ]
2029
2021
pub fn lower_res_to_ty (
2030
2022
& self ,
2031
2023
opt_self_ty : Option < Ty < ' tcx > > ,
2032
2024
path : & hir:: Path < ' tcx > ,
2033
2025
hir_id : hir:: HirId ,
2034
2026
permit_variants : bool ,
2035
2027
) -> Ty < ' tcx > {
2028
+ debug ! ( ?path. res, ?opt_self_ty, ?path. segments) ;
2036
2029
let tcx = self . tcx ( ) ;
2037
2030
2038
- debug ! (
2039
- "res_to_ty(res={:?}, opt_self_ty={:?}, path_segments={:?})" ,
2040
- path. res, opt_self_ty, path. segments
2041
- ) ;
2042
-
2043
2031
let span = path. span ;
2044
2032
match path. res {
2045
2033
Res :: Def ( DefKind :: OpaqueTy , did) => {
@@ -2560,19 +2548,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
2560
2548
result_ty
2561
2549
}
2562
2550
2563
- #[ instrument( level = "debug" , skip ( self ) , ret) ]
2551
+ #[ instrument( level = "debug" , skip_all , ret) ]
2564
2552
fn lower_impl_trait_ty (
2565
2553
& self ,
2566
2554
def_id : DefId ,
2567
2555
lifetimes : & [ hir:: GenericArg < ' _ > ] ,
2568
2556
in_trait : bool ,
2569
2557
) -> Ty < ' tcx > {
2570
- debug ! ( "impl_trait_ty_to_ty(def_id={:?}, lifetimes={:?})" , def_id, lifetimes) ;
2558
+ debug ! ( ? def_id, ? lifetimes) ;
2571
2559
let tcx = self . tcx ( ) ;
2572
2560
2573
2561
let generics = tcx. generics_of ( def_id) ;
2562
+ debug ! ( ?generics) ;
2574
2563
2575
- debug ! ( "impl_trait_ty_to_ty: generics={:?}" , generics) ;
2576
2564
let args = ty:: GenericArgs :: for_item ( tcx, def_id, |param, _| {
2577
2565
// We use `generics.count() - lifetimes.len()` here instead of `generics.parent_count`
2578
2566
// 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 {
2598
2586
tcx. mk_param_from_def ( param)
2599
2587
}
2600
2588
} ) ;
2601
- debug ! ( "impl_trait_ty_to_ty: args={:?}" , args) ;
2589
+ debug ! ( ? args) ;
2602
2590
2603
2591
if in_trait {
2604
2592
Ty :: new_projection ( tcx, def_id, args)
0 commit comments