Skip to content

Commit c4d9a30

Browse files
committed
Tweak debugging
1 parent 929e82f commit c4d9a30

File tree

1 file changed

+17
-13
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+17
-13
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
389389

390390
result.init_free_and_bound_regions();
391391

392+
debug!("Variables and their origins");
393+
for variable in result.definitions.indices() {
394+
let origin = result.definitions[variable].origin;
395+
let universe = result.definitions[variable].universe;
396+
debug!(?variable, ?origin, ?universe);
397+
}
398+
392399
result
393400
}
394401

@@ -560,16 +567,16 @@ impl<'tcx> RegionInferenceContext<'tcx> {
560567
// universe of the scc can name this region.
561568
let scc_universe = self.scc_universes[scc];
562569
if scc_universe.can_name(placeholder.universe) {
563-
debug!(
564-
"init_free_and_bound_regions: placeholder {:?} *is* \
565-
compatible with universe {:?} of its SCC {:?}",
566-
placeholder, scc_universe, scc,
567-
);
570+
// debug!(
571+
// "init_free_and_bound_regions: placeholder {:?} *is* \
572+
// compatible with universe {:?} of its SCC {:?}",
573+
// placeholder, scc_universe, scc,
574+
// );
568575
self.scc_values.add_element(scc, placeholder);
569576
} else {
570577
debug!(
571-
"init_free_and_bound_regions: placeholder {:?} is \
572-
not compatible with universe {:?} of its SCC {:?}",
578+
"init_free_and_bound_regions: placeholder {:?} \
579+
incompatible with universe {:?} of its SCC {:?}",
573580
placeholder, scc_universe, scc,
574581
);
575582
self.add_incompatible_universe(scc);
@@ -905,18 +912,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
905912
/// Returns `true` if all the elements in the value of `scc_b` are nameable
906913
/// in `scc_a`. Used during constraint propagation, and only once
907914
/// the value of `scc_b` has been computed.
908-
#[instrument(level = "debug", skip(self))]
909915
fn universe_compatible(&self, scc_b: ConstraintSccIndex, scc_a: ConstraintSccIndex) -> bool {
910916
let universe_a = self.scc_universes[scc_a];
911917

912918
// Quick check: if scc_b's declared universe is a subset of
913919
// scc_a's declared universe (typically, both are ROOT), then
914920
// it cannot contain any problematic universe elements.
915921
if universe_a.can_name(self.scc_universes[scc_b]) {
916-
debug!(
917-
"{universe_a:?} of {scc_a:?} can name declared universe {declared_universe:?} of {scc_b:?}",
918-
declared_universe = self.scc_universes[scc_b]
919-
);
920922
return true;
921923
}
922924

@@ -925,7 +927,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
925927
// from universe_a
926928
self.scc_values.placeholders_contained_in(scc_b).all(|p| {
927929
let universe_ok = universe_a.can_name(p.universe);
928-
debug!("{universe_a:?} can name {:?} through {p:?}? {universe_ok:?}", p.universe);
930+
if !universe_ok {
931+
debug!("{universe_a:?} CANNOT NAME {:?} through {p:?}!", p.universe);
932+
}
929933
universe_ok
930934
})
931935
}

0 commit comments

Comments
 (0)