Remap elaborated obligation constness
This commit is contained in:
parent
9b75f2d498
commit
08cb878430
@ -145,7 +145,12 @@ fn elaborate(&mut self, obligation: &PredicateObligation<'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…
Reference in New Issue
Block a user