Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank""
This reverts commit 4a742a691e.
This commit is contained in:
@@ -350,6 +350,11 @@ where
|
||||
) -> InterpResult<'tcx, PlaceTy<'tcx, M::Provenance>> {
|
||||
use rustc_middle::mir::ProjectionElem::*;
|
||||
Ok(match proj_elem {
|
||||
OpaqueCast(ty) => {
|
||||
let mut place = base.clone();
|
||||
place.layout = self.layout_of(ty)?;
|
||||
place
|
||||
}
|
||||
Field(field, _) => self.place_field(base, field.index())?,
|
||||
Downcast(_, variant) => self.place_downcast(base, variant)?,
|
||||
Deref => self.deref_operand(&self.place_to_op(base)?)?.into(),
|
||||
@@ -374,6 +379,11 @@ where
|
||||
) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
|
||||
use rustc_middle::mir::ProjectionElem::*;
|
||||
Ok(match proj_elem {
|
||||
OpaqueCast(ty) => {
|
||||
let mut op = base.clone();
|
||||
op.layout = self.layout_of(ty)?;
|
||||
op
|
||||
}
|
||||
Field(field, _) => self.operand_field(base, field.index())?,
|
||||
Downcast(_, variant) => self.operand_downcast(base, variant)?,
|
||||
Deref => self.deref_operand(base)?.into(),
|
||||
|
||||
Reference in New Issue
Block a user