Fix hack that remaps env constness.
WARNING: might have perf implications. Are there any more problems with having a constness in the `ParamEnv` now? :)
This commit is contained in:
parent
d695a497bb
commit
8464396a19
4 changed files with 41 additions and 62 deletions
|
@ -575,6 +575,19 @@ impl<'tcx> Predicate<'tcx> {
|
|||
|
||||
Some(tcx.mk_predicate(kind))
|
||||
}
|
||||
|
||||
pub fn without_const(mut self, tcx: TyCtxt<'tcx>) -> Self {
|
||||
if let PredicateKind::Trait(TraitPredicate { trait_ref, constness, polarity }) = self.kind().skip_binder()
|
||||
&& constness != BoundConstness::NotConst
|
||||
{
|
||||
self = tcx.mk_predicate(self.kind().map_bound(|_| PredicateKind::Trait(TraitPredicate {
|
||||
trait_ref,
|
||||
constness: BoundConstness::NotConst,
|
||||
polarity,
|
||||
})));
|
||||
}
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Predicate<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue