Skip to content

Commit 32fd6e0

Browse files
committed
Describe universe lowering
1 parent d5dc024 commit 32fd6e0

File tree

1 file changed

+5
-7
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+5
-7
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
399399
/// takes on must be a value that each of the regions within the
400400
/// SCC could have as well. This implies that the SCC must have
401401
/// the minimum, or narrowest, universe.
402+
#[instrument(level="debug", skip(constraint_sccs, definitions))]
402403
fn compute_scc_universes(
403404
constraint_sccs: &Sccs<RegionVid, ConstraintSccIndex>,
404405
definitions: &IndexSlice<RegionVid, RegionDefinition<'tcx>>,
405406
) -> IndexVec<ConstraintSccIndex, ty::UniverseIndex> {
406407
let num_sccs = constraint_sccs.num_sccs();
407408
let mut scc_universes = IndexVec::from_elem_n(ty::UniverseIndex::MAX, num_sccs);
408409

409-
debug!("compute_scc_universes()");
410-
411410
// For each region R in universe U, ensure that the universe for the SCC
412411
// that contains R is "no bigger" than U. This effectively sets the universe
413412
// for each SCC to be the minimum of the regions within.
@@ -416,15 +415,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
416415
let scc_universe = &mut scc_universes[scc];
417416
let scc_min = std::cmp::min(region_definition.universe, *scc_universe);
418417
if scc_min != *scc_universe {
419-
*scc_universe = scc_min;
420418
debug!(
421-
"compute_scc_universes: lowered universe of {scc:?} to {scc_min:?} \
419+
"compute_scc_universes: lowered universe of {scc:?} from {previous_universe:?} to {scc_min:?} \
422420
because it contains {region_vid:?} in {region_universe:?}",
423-
scc = scc,
424-
scc_min = scc_min,
425-
region_vid = region_vid,
426421
region_universe = region_definition.universe,
422+
previous_universe = scc_universe,
427423
);
424+
425+
*scc_universe = scc_min;
428426
}
429427
}
430428

0 commit comments

Comments
 (0)