@@ -28,13 +28,13 @@ use std::fmt;
28
28
/// iteration to find region values which satisfy all constraints,
29
29
/// assuming such values can be found. It returns the final values of
30
30
/// all the variables as well as a set of errors that must be reported.
31
+ #[ instrument( level = "debug" , skip( region_rels, var_infos, data) ) ]
31
32
pub fn resolve < ' tcx > (
32
33
region_rels : & RegionRelations < ' _ , ' tcx > ,
33
34
var_infos : VarInfos ,
34
35
data : RegionConstraintData < ' tcx > ,
35
36
mode : RegionckMode ,
36
37
) -> ( LexicalRegionResolutions < ' tcx > , Vec < RegionResolutionError < ' tcx > > ) {
37
- debug ! ( "RegionConstraintData: resolve_regions()" ) ;
38
38
let mut errors = vec ! [ ] ;
39
39
let mut resolver = LexicalResolver { region_rels, var_infos, data } ;
40
40
match mode {
@@ -266,13 +266,14 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
266
266
///
267
267
/// From that list, we look for a *minimal* option `'c_min`. If we
268
268
/// find one, then we can enforce that `'r: 'c_min`.
269
+ #[ instrument( level = "debug" , skip( self , graph, member_constraint, var_values) ) ]
269
270
fn enforce_member_constraint (
270
271
& self ,
271
272
graph : & RegionGraph < ' tcx > ,
272
273
member_constraint : & MemberConstraint < ' tcx > ,
273
274
var_values : & mut LexicalRegionResolutions < ' tcx > ,
274
275
) -> bool {
275
- debug ! ( "enforce_member_constraint( member_constraint={:#?}) " , member_constraint) ;
276
+ debug ! ( "member_constraint={:#?}" , member_constraint) ;
276
277
277
278
// The constraint is some inference variable (`vid`) which
278
279
// must be equal to one of the options.
@@ -311,15 +312,15 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
311
312
Some ( & r) => r,
312
313
None => return false ,
313
314
} ;
314
- debug ! ( "enforce_member_constraint: least_choice={:?}" , least_choice) ;
315
+ debug ! ( ? least_choice) ;
315
316
for & option in options {
316
- debug ! ( "enforce_member_constraint: option={:?}" , option) ;
317
+ debug ! ( ? option) ;
317
318
if !self . sub_concrete_regions ( least_choice, option) {
318
319
if self . sub_concrete_regions ( option, least_choice) {
319
- debug ! ( "enforce_member_constraint: new least choice" ) ;
320
+ debug ! ( "new least choice" ) ;
320
321
least_choice = option;
321
322
} else {
322
- debug ! ( "enforce_member_constraint: no least choice" ) ;
323
+ debug ! ( "no least choice" ) ;
323
324
return false ;
324
325
}
325
326
}
@@ -461,6 +462,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
461
462
}
462
463
463
464
/// True if `a <= b`, but not defined over inference variables.
465
+ #[ instrument( level = "trace" , skip( self ) ) ]
464
466
fn sub_concrete_regions ( & self , a : Region < ' tcx > , b : Region < ' tcx > ) -> bool {
465
467
let tcx = self . tcx ( ) ;
466
468
let sub_free_regions = |r1, r2| self . region_rels . free_regions . sub_free_regions ( tcx, r1, r2) ;
@@ -492,6 +494,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
492
494
///
493
495
/// Neither `a` nor `b` may be an inference variable (hence the
494
496
/// term "concrete regions").
497
+ #[ instrument( level = "trace" , skip( self ) ) ]
495
498
fn lub_concrete_regions ( & self , a : Region < ' tcx > , b : Region < ' tcx > ) -> Region < ' tcx > {
496
499
let r = match ( a, b) {
497
500
( & ReLateBound ( ..) , _) | ( _, & ReLateBound ( ..) ) | ( & ReErased , _) | ( _, & ReErased ) => {
@@ -562,13 +565,14 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
562
565
/// After expansion is complete, go and check upper bounds (i.e.,
563
566
/// cases where the region cannot grow larger than a fixed point)
564
567
/// and check that they are satisfied.
568
+ #[ instrument( skip( self , var_data, errors) ) ]
565
569
fn collect_errors (
566
570
& self ,
567
571
var_data : & mut LexicalRegionResolutions < ' tcx > ,
568
572
errors : & mut Vec < RegionResolutionError < ' tcx > > ,
569
573
) {
570
574
for ( constraint, origin) in & self . data . constraints {
571
- debug ! ( "collect_errors: constraint={:?} origin={:?}" , constraint, origin) ;
575
+ debug ! ( ? constraint, ? origin) ;
572
576
match * constraint {
573
577
Constraint :: RegSubVar ( ..) | Constraint :: VarSubVar ( ..) => {
574
578
// Expansion will ensure that these constraints hold. Ignore.
@@ -580,7 +584,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
580
584
}
581
585
582
586
debug ! (
583
- "collect_errors: region error at {:?}: \
587
+ "region error at {:?}: \
584
588
cannot verify that {:?} <= {:?}",
585
589
origin, sub, sup
586
590
) ;
@@ -606,7 +610,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
606
610
// collect them later.
607
611
if !self . sub_concrete_regions ( a_region, b_region) {
608
612
debug ! (
609
- "collect_errors: region error at {:?}: \
613
+ "region error at {:?}: \
610
614
cannot verify that {:?}={:?} <= {:?}",
611
615
origin, a_vid, a_region, b_region
612
616
) ;
0 commit comments