@@ -72,10 +72,6 @@ pub(crate) fn handle_opaque_type_uses<'tcx>(
72
72
for ( external_name, variable) in
73
73
universal_region_relations. universal_regions . named_universal_regions_iter ( )
74
74
{
75
- debug ! (
76
- "init_free_and_bound_regions: region {:?} has external name {:?}" ,
77
- variable, external_name
78
- ) ;
79
75
definitions[ variable] . external_name = Some ( external_name) ;
80
76
}
81
77
@@ -119,6 +115,8 @@ pub(crate) fn handle_opaque_type_uses<'tcx>(
119
115
}
120
116
}
121
117
118
+ debug ! ( ?opaque_type_key, ?hidden_type, "check defining use" ) ;
119
+
122
120
let opaque_type_key = opaque_type_key. fold_captured_lifetime_args ( tcx, |region| {
123
121
let scc = constraint_sccs. scc ( region. as_var ( ) ) ;
124
122
let vid = constraint_sccs. annotation ( scc) . representative ;
@@ -247,16 +245,19 @@ struct OpaqueHiddenTypeFolder<'a, 'tcx> {
247
245
}
248
246
249
247
impl < ' tcx > OpaqueHiddenTypeFolder < ' _ , ' tcx > {
248
+ #[ instrument( level = "debug" , skip( self ) ) ]
250
249
fn apply_member_constraint ( & mut self , r : RegionVid ) -> Option < Region < ' tcx > > {
251
250
let member = self . constraint_sccs . scc ( r) ;
252
251
253
252
if let Some ( ( _, reg) ) = self . arg_regions . iter ( ) . copied ( ) . find ( |& ( vid, _) | vid == r) {
253
+ debug ! ( "member equal to arg" ) ;
254
254
return Some ( reg) ;
255
255
}
256
256
257
257
// If the member region lives in a higher universe, we currently choose
258
258
// the most conservative option by leaving it unchanged.
259
259
if !self . constraint_sccs . annotation ( member) . min_universe ( ) . is_root ( ) {
260
+ debug ! ( "member not in root universe" ) ;
260
261
return None ;
261
262
}
262
263
@@ -273,6 +274,7 @@ impl<'tcx> OpaqueHiddenTypeFolder<'_, 'tcx> {
273
274
} )
274
275
} )
275
276
. collect :: < Vec < _ > > ( ) ;
277
+ debug ! ( ?choice_regions, "after enforcing lower-bound" ) ;
276
278
277
279
// Now find all the *upper bounds* -- that is, each UB is a
278
280
// free region that must outlive the member region `R0` (`UB:
@@ -282,6 +284,8 @@ impl<'tcx> OpaqueHiddenTypeFolder<'_, 'tcx> {
282
284
choice_regions. retain ( |& ( o_r, _) | self . universal_region_relations . outlives ( ub, o_r) ) ;
283
285
}
284
286
287
+ debug ! ( ?choice_regions, "after enforcing upper-bound" ) ;
288
+
285
289
// At this point we can pick any member of `choice_regions` and would like to choose
286
290
// it to be a small as possible. To avoid potential non-determinism we will pick the
287
291
// smallest such choice.
@@ -319,7 +323,7 @@ impl<'tcx> OpaqueHiddenTypeFolder<'_, 'tcx> {
319
323
debug ! ( "no unique minimum choice" ) ;
320
324
return None ;
321
325
} ;
322
-
326
+ debug ! ( ?min_choice ) ;
323
327
Some ( min_choice)
324
328
}
325
329
0 commit comments