@@ -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
@@ -1704,6 +1699,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1704
1699
. collect ( )
1705
1700
}
1706
1701
1702
+ #[ instrument( level = "debug" , skip_all) ]
1707
1703
fn lower_qpath_to_ty (
1708
1704
& self ,
1709
1705
span : Span ,
@@ -1716,22 +1712,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1716
1712
let tcx = self . tcx ( ) ;
1717
1713
1718
1714
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) ;
1721
1716
1722
1717
let Some ( self_ty) = opt_self_ty else {
1723
1718
let path_str = tcx. def_path_str ( trait_def_id) ;
1724
1719
1725
1720
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) ;
1728
1722
1729
1723
let parent_def_id = def_id
1730
1724
. as_local ( )
1731
1725
. map ( |def_id| tcx. local_def_id_to_hir_id ( def_id) )
1732
1726
. 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) ;
1735
1728
1736
1729
// If the trait in segment is the same as the trait defining the item,
1737
1730
// use the `<Self as ..>` syntax in the error.
@@ -1766,8 +1759,7 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1766
1759
) ;
1767
1760
return Ty :: new_error ( tcx, reported) ;
1768
1761
} ;
1769
-
1770
- debug ! ( "qpath_to_ty: self_type={:?}" , self_ty) ;
1762
+ debug ! ( ?self_ty) ;
1771
1763
1772
1764
let trait_ref = self . lower_path_to_mono_trait_ref (
1773
1765
span,
@@ -1777,12 +1769,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
1777
1769
false ,
1778
1770
constness,
1779
1771
) ;
1772
+ debug ! ( ?trait_ref) ;
1780
1773
1781
1774
let item_args =
1782
1775
self . lower_args_for_assoc_item ( span, item_def_id, item_segment, trait_ref. args ) ;
1783
1776
1784
- debug ! ( "qpath_to_ty: trait_ref={:?}" , trait_ref) ;
1785
-
1786
1777
Ty :: new_projection ( tcx, item_def_id, item_args)
1787
1778
}
1788
1779
@@ -2025,20 +2016,17 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
2025
2016
}
2026
2017
2027
2018
/// Check a type `Path` and lower it to a `Ty`.
2019
+ #[ instrument( level = "debug" , skip_all) ]
2028
2020
pub fn lower_res_to_ty (
2029
2021
& self ,
2030
2022
opt_self_ty : Option < Ty < ' tcx > > ,
2031
2023
path : & hir:: Path < ' tcx > ,
2032
2024
hir_id : hir:: HirId ,
2033
2025
permit_variants : bool ,
2034
2026
) -> Ty < ' tcx > {
2027
+ debug ! ( ?path. res, ?opt_self_ty, ?path. segments) ;
2035
2028
let tcx = self . tcx ( ) ;
2036
2029
2037
- debug ! (
2038
- "res_to_ty(res={:?}, opt_self_ty={:?}, path_segments={:?})" ,
2039
- path. res, opt_self_ty, path. segments
2040
- ) ;
2041
-
2042
2030
let span = path. span ;
2043
2031
match path. res {
2044
2032
Res :: Def ( DefKind :: OpaqueTy , did) => {
@@ -2572,19 +2560,19 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
2572
2560
result_ty
2573
2561
}
2574
2562
2575
- #[ instrument( level = "debug" , skip ( self ) , ret) ]
2563
+ #[ instrument( level = "debug" , skip_all , ret) ]
2576
2564
fn lower_impl_trait_ty (
2577
2565
& self ,
2578
2566
def_id : DefId ,
2579
2567
lifetimes : & [ hir:: GenericArg < ' _ > ] ,
2580
2568
in_trait : bool ,
2581
2569
) -> Ty < ' tcx > {
2582
- debug ! ( "impl_trait_ty_to_ty(def_id={:?}, lifetimes={:?})" , def_id, lifetimes) ;
2570
+ debug ! ( ? def_id, ? lifetimes) ;
2583
2571
let tcx = self . tcx ( ) ;
2584
2572
2585
2573
let generics = tcx. generics_of ( def_id) ;
2574
+ debug ! ( ?generics) ;
2586
2575
2587
- debug ! ( "impl_trait_ty_to_ty: generics={:?}" , generics) ;
2588
2576
let args = ty:: GenericArgs :: for_item ( tcx, def_id, |param, _| {
2589
2577
// We use `generics.count() - lifetimes.len()` here instead of `generics.parent_count`
2590
2578
// 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 {
2610
2598
tcx. mk_param_from_def ( param)
2611
2599
}
2612
2600
} ) ;
2613
- debug ! ( "impl_trait_ty_to_ty: args={:?}" , args) ;
2601
+ debug ! ( ? args) ;
2614
2602
2615
2603
if in_trait {
2616
2604
Ty :: new_projection ( tcx, def_id, args)
0 commit comments