Assert that we don't convert unevaluated MIR promoteds to unevaluated type constants

This commit is contained in:
Oli Scherer 2023-06-26 09:32:15 +00:00
parent acdfec6061
commit 1c992c0b1c

View file

@ -2581,10 +2581,9 @@ pub struct UnevaluatedConst<'tcx> {
}
impl<'tcx> UnevaluatedConst<'tcx> {
// FIXME: probably should get rid of this method. It's also wrong to
// shrink and then later expand a promoted.
#[inline]
pub fn shrink(self) -> ty::UnevaluatedConst<'tcx> {
assert_eq!(self.promoted, None);
ty::UnevaluatedConst { def: self.def, substs: self.substs }
}
}