Skip to content

Commit da12d02

Browse files
nikomatsakiswesleywiser
authored andcommitted
useful debug in universal_regions
1 parent bf6fe2a commit da12d02

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/librustc_mir/borrow_check/nll/universal_regions.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,14 +619,15 @@ impl<'cx, 'gcx, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'cx, 'gcx, 'tcx> {
619619
value, all_outlive_scope,
620620
);
621621
let (value, _map) = self.tcx.replace_late_bound_regions(value, |br| {
622+
debug!("replace_bound_regions_with_nll_infer_vars: br={:?}", br);
622623
let liberated_region = self.tcx.mk_region(ty::ReFree(ty::FreeRegion {
623624
scope: all_outlive_scope,
624625
bound_region: br,
625626
}));
626627
let region_vid = self.next_nll_region_var(origin);
627628
indices.insert_late_bound_region(liberated_region, region_vid.to_region_vid());
628629
debug!(
629-
"liberated_region={:?} => {:?}",
630+
"replace_bound_regions_with_nll_infer_vars: liberated_region={:?} => {:?}",
630631
liberated_region, region_vid
631632
);
632633
region_vid
@@ -648,12 +649,18 @@ impl<'cx, 'gcx, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'cx, 'gcx, 'tcx> {
648649
mir_def_id: DefId,
649650
indices: &mut UniversalRegionIndices<'tcx>,
650651
) {
652+
debug!(
653+
"replace_late_bound_regions_with_nll_infer_vars(mir_def_id={:?})",
654+
mir_def_id
655+
);
651656
let closure_base_def_id = self.tcx.closure_base_def_id(mir_def_id);
652657
for_each_late_bound_region_defined_on(self.tcx, closure_base_def_id, |r| {
658+
debug!("replace_late_bound_regions_with_nll_infer_vars: r={:?}", r);
653659
if !indices.indices.contains_key(&r) {
654660
let region_vid = self.next_nll_region_var(FR);
655661
indices.insert_late_bound_region(r, region_vid.to_region_vid());
656-
}});
662+
}
663+
});
657664
}
658665
}
659666

0 commit comments

Comments
 (0)