Skip to content

Commit 7081997

Browse files
committed
More tracing
1 parent 5293c6a commit 7081997

File tree

1 file changed

+10
-1
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+10
-1
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use rustc_middle::traits::ObligationCauseCode;
2222
use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt, TypeFoldable};
2323
use rustc_mir_dataflow::points::DenseLocationMap;
2424
use rustc_span::Span;
25+
use tracing::instrument;
2526

2627
use crate::constraints::graph::{self, NormalConstraintGraph, RegionGraph};
2728
use crate::dataflow::BorrowIndex;
@@ -899,6 +900,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
899900
/// Returns `true` if all the elements in the value of `scc_b` are nameable
900901
/// in `scc_a`. Used during constraint propagation, and only once
901902
/// the value of `scc_b` has been computed.
903+
#[instrument(level = "debug", skip(self))]
902904
fn universe_compatible(&self, scc_b: ConstraintSccIndex, scc_a: ConstraintSccIndex) -> bool {
903905
let universe_a = self.scc_universes[scc_a];
904906

@@ -912,7 +914,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
912914
// Otherwise, we have to iterate over the universe elements in
913915
// B's value, and check whether all of them are nameable
914916
// from universe_a
915-
self.scc_values.placeholders_contained_in(scc_b).all(|p| universe_a.can_name(p.universe))
917+
self.scc_values.placeholders_contained_in(scc_b).all(|p| {
918+
if universe_a.can_name(p.universe) {
919+
true
920+
} else {
921+
debug!("{universe_a:?} cannot name {:?} through {p:?}", p.universe);
922+
false
923+
}
924+
})
916925
}
917926

918927
/// Extend `scc` so that it can outlive some placeholder region

0 commit comments

Comments
 (0)