@@ -1167,8 +1167,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11671167 /// Therefore, this method should only be used in diagnostic code,
11681168 /// where displaying *some* named universal region is better than
11691169 /// falling back to 'static.
1170+ #[ instrument( level = "debug" , skip( self ) ) ]
11701171 pub ( crate ) fn approx_universal_upper_bound ( & self , r : RegionVid ) -> RegionVid {
1171- debug ! ( "approx_universal_upper_bound(r={:?}={})" , r , self . region_value_str( r) ) ;
1172+ debug ! ( "{}" , self . region_value_str( r) ) ;
11721173
11731174 // Find the smallest universal region that contains all other
11741175 // universal regions within `region`.
@@ -1177,7 +1178,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11771178 let static_r = self . universal_regions . fr_static ;
11781179 for ur in self . scc_values . universal_regions_outlived_by ( r_scc) {
11791180 let new_lub = self . universal_region_relations . postdom_upper_bound ( lub, ur) ;
1180- debug ! ( "approx_universal_upper_bound: ur={:?} lub={:?} new_lub={:?}" , ur, lub, new_lub) ;
1181+ debug ! ( ? ur, ? lub, ? new_lub) ;
11811182 // The upper bound of two non-static regions is static: this
11821183 // means we know nothing about the relationship between these
11831184 // two regions. Pick a 'better' one to use when constructing
@@ -1201,7 +1202,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
12011202 }
12021203 }
12031204
1204- debug ! ( "approx_universal_upper_bound: r={:?} lub={:?}" , r, lub) ;
1205+ debug ! ( ? r, ? lub) ;
12051206
12061207 lub
12071208 }
@@ -2048,23 +2049,19 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20482049 /// creating a constraint path that forces `R` to outlive
20492050 /// `from_region`, and then finding the best choices within that
20502051 /// path to blame.
2052+ #[ instrument( level = "debug" , skip( self , target_test) ) ]
20512053 pub ( crate ) fn best_blame_constraint (
20522054 & self ,
20532055 body : & Body < ' tcx > ,
20542056 from_region : RegionVid ,
20552057 from_region_origin : NllRegionVariableOrigin ,
20562058 target_test : impl Fn ( RegionVid ) -> bool ,
20572059 ) -> BlameConstraint < ' tcx > {
2058- debug ! (
2059- "best_blame_constraint(from_region={:?}, from_region_origin={:?})" ,
2060- from_region, from_region_origin
2061- ) ;
2062-
20632060 // Find all paths
20642061 let ( path, target_region) =
20652062 self . find_constraint_paths_between_regions ( from_region, target_test) . unwrap ( ) ;
20662063 debug ! (
2067- "best_blame_constraint: path={:#?}" ,
2064+ "path={:#?}" ,
20682065 path. iter( )
20692066 . map( |c| format!(
20702067 "{:?} ({:?}: {:?})" ,
@@ -2116,7 +2113,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
21162113 }
21172114 } )
21182115 . collect ( ) ;
2119- debug ! ( "best_blame_constraint: categorized_path={:#?}" , categorized_path) ;
2116+ debug ! ( "categorized_path={:#?}" , categorized_path) ;
21202117
21212118 // To find the best span to cite, we first try to look for the
21222119 // final constraint that is interesting and where the `sup` is
@@ -2214,10 +2211,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
22142211 let best_choice =
22152212 if blame_source { range. rev ( ) . find ( find_region) } else { range. find ( find_region) } ;
22162213
2217- debug ! (
2218- "best_blame_constraint: best_choice={:?} blame_source={}" ,
2219- best_choice, blame_source
2220- ) ;
2214+ debug ! ( ?best_choice, ?blame_source) ;
22212215
22222216 if let Some ( i) = best_choice {
22232217 if let Some ( next) = categorized_path. get ( i + 1 ) {
@@ -2254,7 +2248,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
22542248 // appears to be the most interesting point to report to the
22552249 // user via an even more ad-hoc guess.
22562250 categorized_path. sort_by ( |p0, p1| p0. category . cmp ( & p1. category ) ) ;
2257- debug ! ( "best_blame_constraint: sorted_path={:#?}" , categorized_path) ;
2251+ debug ! ( "sorted_path={:#?}" , categorized_path) ;
22582252
22592253 categorized_path. remove ( 0 )
22602254 }
0 commit comments