Skip to content

Commit 410f520

Browse files
nikomatsakispietroalbini
authored andcommitted
improve debug output related to bound calculation
1 parent 8a6f4c8 commit 410f520

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

src/librustc/traits/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,12 @@ fn do_normalize_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
693693
predicates: Vec<ty::Predicate<'tcx>>)
694694
-> Result<Vec<ty::Predicate<'tcx>>, ErrorReported>
695695
{
696-
debug!("do_normalize_predicates({:?})", predicates);
696+
debug!(
697+
"do_normalize_predicates(predicates={:?}, region_context={:?}, cause={:?})",
698+
predicates,
699+
region_context,
700+
cause,
701+
);
697702
let span = cause.span;
698703
tcx.infer_ctxt().enter(|infcx| {
699704
// FIXME. We should really... do something with these region

src/librustc_typeck/collect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,7 @@ fn predicates_defined_on<'a, 'tcx>(
15911591
tcx: TyCtxt<'a, 'tcx, 'tcx>,
15921592
def_id: DefId,
15931593
) -> ty::GenericPredicates<'tcx> {
1594+
debug!("predicates_defined_on({:?})", def_id);
15941595
let explicit = tcx.explicit_predicates_of(def_id);
15951596
let span = tcx.def_span(def_id);
15961597
let predicates = explicit.predicates.into_iter().chain(

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)