Remap elaborated obligation constness
This commit is contained in:
parent
9b75f2d498
commit
08cb878430
1 changed files with 6 additions and 1 deletions
|
@ -145,7 +145,12 @@ impl<'tcx> Elaborator<'tcx> {
|
|||
// Get predicates declared on the trait.
|
||||
let predicates = tcx.super_predicates_of(data.def_id());
|
||||
|
||||
let obligations = predicates.predicates.iter().map(|&(pred, _)| {
|
||||
let obligations = predicates.predicates.iter().map(|&(mut pred, _)| {
|
||||
// when parent predicate is non-const, elaborate it to non-const predicates.
|
||||
if data.constness == ty::BoundConstness::NotConst {
|
||||
pred = pred.without_const(tcx);
|
||||
}
|
||||
|
||||
predicate_obligation(
|
||||
pred.subst_supertrait(tcx, &bound_predicate.rebind(data.trait_ref)),
|
||||
obligation.param_env,
|
||||
|
|
Loading…
Add table
Reference in a new issue