Skip to content

Commit 0d744ec

Browse files
committed
improve debug output related to bound calculation
1 parent 6b9b97b commit 0d744ec

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

src/librustc/traits/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,12 @@ fn do_normalize_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
700700
predicates: Vec<ty::Predicate<'tcx>>)
701701
-> Result<Vec<ty::Predicate<'tcx>>, ErrorReported>
702702
{
703-
debug!("do_normalize_predicates({:?})", predicates);
703+
debug!(
704+
"do_normalize_predicates(predicates={:?}, region_context={:?}, cause={:?})",
705+
predicates,
706+
region_context,
707+
cause,
708+
);
704709
let span = cause.span;
705710
tcx.infer_ctxt().enter(|infcx| {
706711
// FIXME. We should really... do something with these region

src/librustc_typeck/collect.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,10 +1608,21 @@ fn predicates_defined_on<'a, 'tcx>(
16081608
tcx: TyCtxt<'a, 'tcx, 'tcx>,
16091609
def_id: DefId,
16101610
) -> Lrc<ty::GenericPredicates<'tcx>> {
1611+
debug!("predicates_defined_on({:?})", def_id);
16111612
let mut result = tcx.explicit_predicates_of(def_id);
1613+
debug!(
1614+
"predicates_defined_on: explicit_predicates_of({:?}) = {:?}",
1615+
def_id,
1616+
result,
1617+
);
16121618
let inferred_outlives = tcx.inferred_outlives_of(def_id);
16131619
if !inferred_outlives.is_empty() {
16141620
let span = tcx.def_span(def_id);
1621+
debug!(
1622+
"predicates_defined_on: inferred_outlives_of({:?}) = {:?}",
1623+
def_id,
1624+
inferred_outlives,
1625+
);
16151626
Lrc::make_mut(&mut result)
16161627
.predicates
16171628
.extend(inferred_outlives.iter().map(|&p| (p, span)));

src/librustc_typeck/outlives/implicit_infer.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ fn insert_required_predicates_to_be_wf<'tcx>(
245245
}
246246
}
247247

248+
#[derive(Debug)]
248249
pub struct IgnoreSelfTy(bool);
249250

250251
/// We also have to check the explicit predicates
@@ -270,10 +271,18 @@ pub fn check_explicit_predicates<'tcx>(
270271
explicit_map: &mut ExplicitPredicatesMap<'tcx>,
271272
ignore_self_ty: IgnoreSelfTy,
272273
) {
273-
debug!("def_id = {:?}", &def_id);
274-
debug!("substs = {:?}", &substs);
275-
debug!("explicit_map = {:?}", explicit_map);
276-
debug!("required_predicates = {:?}", required_predicates);
274+
debug!(
275+
"check_explicit_predicates(def_id={:?}, \
276+
substs={:?}, \
277+
explicit_map={:?}, \
278+
required_predicates={:?}, \
279+
ignore_self_ty={:?})",
280+
def_id,
281+
substs,
282+
explicit_map,
283+
required_predicates,
284+
ignore_self_ty,
285+
);
277286
let explicit_predicates = explicit_map.explicit_predicates_of(tcx, *def_id);
278287

279288
for outlives_predicate in explicit_predicates.iter() {

src/librustc_typeck/outlives/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ fn inferred_outlives_of<'a, 'tcx>(
6767
}
6868
err.emit();
6969
}
70+
71+
debug!("inferred_outlives_of({:?}) = {:?}", item_def_id, predicates);
72+
7073
predicates
7174
}
7275

0 commit comments

Comments
 (0)