remap ParamEnv with obligation
This commit is contained in:
parent
08aeb1aa9b
commit
5ead742e18
4 changed files with 24 additions and 8 deletions
|
@ -67,6 +67,14 @@ impl<'tcx> PredicateObligation<'tcx> {
|
|||
recursion_depth: self.recursion_depth,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn without_const(mut self, tcx: TyCtxt<'tcx>) -> PredicateObligation<'tcx> {
|
||||
self.param_env = self.param_env.without_const();
|
||||
if let ty::PredicateKind::Trait(trait_pred) = self.predicate.kind().skip_binder() && trait_pred.is_const_if_const() {
|
||||
self.predicate = tcx.mk_predicate(self.predicate.kind().map_bound(|_| ty::PredicateKind::Trait(trait_pred.without_const())));
|
||||
}
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> TraitObligation<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue