improve debug output related to bound calculation
This commit is contained in:
parent
6b9b97bd9b
commit
0d744ec6ec
4 changed files with 33 additions and 5 deletions
|
@ -700,7 +700,12 @@ fn do_normalize_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
predicates: Vec<ty::Predicate<'tcx>>)
|
predicates: Vec<ty::Predicate<'tcx>>)
|
||||||
-> Result<Vec<ty::Predicate<'tcx>>, ErrorReported>
|
-> Result<Vec<ty::Predicate<'tcx>>, ErrorReported>
|
||||||
{
|
{
|
||||||
debug!("do_normalize_predicates({:?})", predicates);
|
debug!(
|
||||||
|
"do_normalize_predicates(predicates={:?}, region_context={:?}, cause={:?})",
|
||||||
|
predicates,
|
||||||
|
region_context,
|
||||||
|
cause,
|
||||||
|
);
|
||||||
let span = cause.span;
|
let span = cause.span;
|
||||||
tcx.infer_ctxt().enter(|infcx| {
|
tcx.infer_ctxt().enter(|infcx| {
|
||||||
// FIXME. We should really... do something with these region
|
// FIXME. We should really... do something with these region
|
||||||
|
|
|
@ -1608,10 +1608,21 @@ fn predicates_defined_on<'a, 'tcx>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
) -> Lrc<ty::GenericPredicates<'tcx>> {
|
) -> Lrc<ty::GenericPredicates<'tcx>> {
|
||||||
|
debug!("predicates_defined_on({:?})", def_id);
|
||||||
let mut result = tcx.explicit_predicates_of(def_id);
|
let mut result = tcx.explicit_predicates_of(def_id);
|
||||||
|
debug!(
|
||||||
|
"predicates_defined_on: explicit_predicates_of({:?}) = {:?}",
|
||||||
|
def_id,
|
||||||
|
result,
|
||||||
|
);
|
||||||
let inferred_outlives = tcx.inferred_outlives_of(def_id);
|
let inferred_outlives = tcx.inferred_outlives_of(def_id);
|
||||||
if !inferred_outlives.is_empty() {
|
if !inferred_outlives.is_empty() {
|
||||||
let span = tcx.def_span(def_id);
|
let span = tcx.def_span(def_id);
|
||||||
|
debug!(
|
||||||
|
"predicates_defined_on: inferred_outlives_of({:?}) = {:?}",
|
||||||
|
def_id,
|
||||||
|
inferred_outlives,
|
||||||
|
);
|
||||||
Lrc::make_mut(&mut result)
|
Lrc::make_mut(&mut result)
|
||||||
.predicates
|
.predicates
|
||||||
.extend(inferred_outlives.iter().map(|&p| (p, span)));
|
.extend(inferred_outlives.iter().map(|&p| (p, span)));
|
||||||
|
|
|
@ -245,6 +245,7 @@ fn insert_required_predicates_to_be_wf<'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct IgnoreSelfTy(bool);
|
pub struct IgnoreSelfTy(bool);
|
||||||
|
|
||||||
/// We also have to check the explicit predicates
|
/// We also have to check the explicit predicates
|
||||||
|
@ -270,10 +271,18 @@ pub fn check_explicit_predicates<'tcx>(
|
||||||
explicit_map: &mut ExplicitPredicatesMap<'tcx>,
|
explicit_map: &mut ExplicitPredicatesMap<'tcx>,
|
||||||
ignore_self_ty: IgnoreSelfTy,
|
ignore_self_ty: IgnoreSelfTy,
|
||||||
) {
|
) {
|
||||||
debug!("def_id = {:?}", &def_id);
|
debug!(
|
||||||
debug!("substs = {:?}", &substs);
|
"check_explicit_predicates(def_id={:?}, \
|
||||||
debug!("explicit_map = {:?}", explicit_map);
|
substs={:?}, \
|
||||||
debug!("required_predicates = {:?}", required_predicates);
|
explicit_map={:?}, \
|
||||||
|
required_predicates={:?}, \
|
||||||
|
ignore_self_ty={:?})",
|
||||||
|
def_id,
|
||||||
|
substs,
|
||||||
|
explicit_map,
|
||||||
|
required_predicates,
|
||||||
|
ignore_self_ty,
|
||||||
|
);
|
||||||
let explicit_predicates = explicit_map.explicit_predicates_of(tcx, *def_id);
|
let explicit_predicates = explicit_map.explicit_predicates_of(tcx, *def_id);
|
||||||
|
|
||||||
for outlives_predicate in explicit_predicates.iter() {
|
for outlives_predicate in explicit_predicates.iter() {
|
||||||
|
|
|
@ -67,6 +67,9 @@ fn inferred_outlives_of<'a, 'tcx>(
|
||||||
}
|
}
|
||||||
err.emit();
|
err.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug!("inferred_outlives_of({:?}) = {:?}", item_def_id, predicates);
|
||||||
|
|
||||||
predicates
|
predicates
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue