@@ -1167,8 +1167,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1167
1167
/// Therefore, this method should only be used in diagnostic code,
1168
1168
/// where displaying *some* named universal region is better than
1169
1169
/// falling back to 'static.
1170
+ #[ instrument( level = "debug" , skip( self ) ) ]
1170
1171
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) ) ;
1172
1173
1173
1174
// Find the smallest universal region that contains all other
1174
1175
// universal regions within `region`.
@@ -1177,7 +1178,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1177
1178
let static_r = self . universal_regions . fr_static ;
1178
1179
for ur in self . scc_values . universal_regions_outlived_by ( r_scc) {
1179
1180
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) ;
1181
1182
// The upper bound of two non-static regions is static: this
1182
1183
// means we know nothing about the relationship between these
1183
1184
// two regions. Pick a 'better' one to use when constructing
@@ -1201,7 +1202,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1201
1202
}
1202
1203
}
1203
1204
1204
- debug ! ( "approx_universal_upper_bound: r={:?} lub={:?}" , r, lub) ;
1205
+ debug ! ( ? r, ? lub) ;
1205
1206
1206
1207
lub
1207
1208
}
@@ -2048,23 +2049,19 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2048
2049
/// creating a constraint path that forces `R` to outlive
2049
2050
/// `from_region`, and then finding the best choices within that
2050
2051
/// path to blame.
2052
+ #[ instrument( level = "debug" , skip( self , target_test) ) ]
2051
2053
pub ( crate ) fn best_blame_constraint (
2052
2054
& self ,
2053
2055
body : & Body < ' tcx > ,
2054
2056
from_region : RegionVid ,
2055
2057
from_region_origin : NllRegionVariableOrigin ,
2056
2058
target_test : impl Fn ( RegionVid ) -> bool ,
2057
2059
) -> BlameConstraint < ' tcx > {
2058
- debug ! (
2059
- "best_blame_constraint(from_region={:?}, from_region_origin={:?})" ,
2060
- from_region, from_region_origin
2061
- ) ;
2062
-
2063
2060
// Find all paths
2064
2061
let ( path, target_region) =
2065
2062
self . find_constraint_paths_between_regions ( from_region, target_test) . unwrap ( ) ;
2066
2063
debug ! (
2067
- "best_blame_constraint: path={:#?}" ,
2064
+ "path={:#?}" ,
2068
2065
path. iter( )
2069
2066
. map( |c| format!(
2070
2067
"{:?} ({:?}: {:?})" ,
@@ -2116,7 +2113,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2116
2113
}
2117
2114
} )
2118
2115
. collect ( ) ;
2119
- debug ! ( "best_blame_constraint: categorized_path={:#?}" , categorized_path) ;
2116
+ debug ! ( "categorized_path={:#?}" , categorized_path) ;
2120
2117
2121
2118
// To find the best span to cite, we first try to look for the
2122
2119
// final constraint that is interesting and where the `sup` is
@@ -2214,10 +2211,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2214
2211
let best_choice =
2215
2212
if blame_source { range. rev ( ) . find ( find_region) } else { range. find ( find_region) } ;
2216
2213
2217
- debug ! (
2218
- "best_blame_constraint: best_choice={:?} blame_source={}" ,
2219
- best_choice, blame_source
2220
- ) ;
2214
+ debug ! ( ?best_choice, ?blame_source) ;
2221
2215
2222
2216
if let Some ( i) = best_choice {
2223
2217
if let Some ( next) = categorized_path. get ( i + 1 ) {
@@ -2254,7 +2248,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2254
2248
// appears to be the most interesting point to report to the
2255
2249
// user via an even more ad-hoc guess.
2256
2250
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) ;
2258
2252
2259
2253
categorized_path. remove ( 0 )
2260
2254
}
0 commit comments