@@ -83,6 +83,7 @@ pub struct OpaqueTypeDecl<'tcx> {
83
83
}
84
84
85
85
/// Whether member constraints should be generated for all opaque types
86
+ #[ derive( Debug ) ]
86
87
pub enum GenerateMemberConstraints {
87
88
/// The default, used by typeck
88
89
WhenRequired ,
@@ -354,8 +355,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
354
355
opaque_types : & OpaqueTypeMap < ' tcx > ,
355
356
free_region_relations : & FRR ,
356
357
) {
357
- debug ! ( "constrain_opaque_types()" ) ;
358
-
359
358
for & ( opaque_type_key, opaque_defn) in opaque_types {
360
359
self . constrain_opaque_type (
361
360
opaque_type_key,
@@ -367,6 +366,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
367
366
}
368
367
369
368
/// See `constrain_opaque_types` for documentation.
369
+ #[ instrument( level = "debug" , skip( self , free_region_relations) ) ]
370
370
fn constrain_opaque_type < FRR : FreeRegionRelations < ' tcx > > (
371
371
& self ,
372
372
opaque_type_key : OpaqueTypeKey < ' tcx > ,
@@ -376,15 +376,11 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
376
376
) {
377
377
let def_id = opaque_type_key. def_id ;
378
378
379
- debug ! ( "constrain_opaque_type()" ) ;
380
- debug ! ( "constrain_opaque_type: def_id={:?}" , def_id) ;
381
- debug ! ( "constrain_opaque_type: opaque_defn={:#?}" , opaque_defn) ;
382
-
383
379
let tcx = self . tcx ;
384
380
385
381
let concrete_ty = self . resolve_vars_if_possible ( opaque_defn. concrete_ty ) ;
386
382
387
- debug ! ( "constrain_opaque_type: concrete_ty={:?}" , concrete_ty) ;
383
+ debug ! ( ? concrete_ty) ;
388
384
389
385
let first_own_region = match opaque_defn. origin {
390
386
hir:: OpaqueTyOrigin :: FnReturn | hir:: OpaqueTyOrigin :: AsyncFn => {
@@ -397,7 +393,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
397
393
// type foo::<'p0..'pn>::Foo<'q0..'qm>
398
394
// fn foo<l0..'ln>() -> foo::<'static..'static>::Foo<'l0..'lm>.
399
395
//
400
- // For these types we onlt iterate over `'l0..lm` below.
396
+ // For these types we only iterate over `'l0..lm` below.
401
397
tcx. generics_of ( def_id) . parent_count
402
398
}
403
399
// These opaque type inherit all lifetime parameters from their
@@ -410,10 +406,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
410
406
// If there are required region bounds, we can use them.
411
407
if opaque_defn. has_required_region_bounds {
412
408
let bounds = tcx. explicit_item_bounds ( def_id) ;
413
- debug ! ( "constrain_opaque_type: predicates: {:#?}" , bounds) ;
409
+ debug ! ( "{:#?}" , bounds) ;
414
410
let bounds: Vec < _ > =
415
411
bounds. iter ( ) . map ( |( bound, _) | bound. subst ( tcx, opaque_type_key. substs ) ) . collect ( ) ;
416
- debug ! ( "constrain_opaque_type: bounds= {:#?}" , bounds) ;
412
+ debug ! ( "{:#?}" , bounds) ;
417
413
let opaque_type = tcx. mk_opaque ( def_id, opaque_type_key. substs ) ;
418
414
419
415
let required_region_bounds =
@@ -452,8 +448,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
452
448
} ;
453
449
454
450
// Compute the least upper bound of it with the other regions.
455
- debug ! ( "constrain_opaque_types: least_region={:?}" , least_region) ;
456
- debug ! ( "constrain_opaque_types: subst_region={:?}" , subst_region) ;
451
+ debug ! ( ? least_region) ;
452
+ debug ! ( ? subst_region) ;
457
453
match least_region {
458
454
None => least_region = Some ( subst_region) ,
459
455
Some ( lr) => {
@@ -484,7 +480,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
484
480
}
485
481
486
482
let least_region = least_region. unwrap_or ( tcx. lifetimes . re_static ) ;
487
- debug ! ( "constrain_opaque_types: least_region={:?}" , least_region) ;
483
+ debug ! ( ? least_region) ;
488
484
489
485
if let GenerateMemberConstraints :: IfNoStaticBound = mode {
490
486
if least_region != tcx. lifetimes . re_static {
0 commit comments