diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index c72078fa89cd2..9dbcb07cd99e8 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -116,9 +116,10 @@ impl<'tcx, Tag> ::std::ops::Deref for ImmTy<'tcx, Tag> { /// or still in memory. The latter is an optimization, to delay reading that chunk of /// memory and to avoid having to store arbitrary-sized data here. #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] -pub enum Operand { +pub enum Operand { Immediate(Immediate), Indirect(MemPlace), + Symbolic(Sym), } impl Operand { @@ -146,20 +147,20 @@ impl Operand { } #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] -pub struct OpTy<'tcx, Tag=()> { - op: Operand, +pub struct OpTy<'tcx, Tag=(), Sym=!> { + op: Operand, pub layout: TyLayout<'tcx>, } -impl<'tcx, Tag> ::std::ops::Deref for OpTy<'tcx, Tag> { - type Target = Operand; +impl<'tcx, Tag, Sym> ::std::ops::Deref for OpTy<'tcx, Tag, Sym> { + type Target = Operand; #[inline(always)] - fn deref(&self) -> &Operand { + fn deref(&self) -> &Self::Target { &self.op } } -impl<'tcx, Tag: Copy> From> for OpTy<'tcx, Tag> { +impl<'tcx, Tag: Copy, Sym> From> for OpTy<'tcx, Tag, Sym> { #[inline(always)] fn from(mplace: MPlaceTy<'tcx, Tag>) -> Self { OpTy { @@ -169,7 +170,7 @@ impl<'tcx, Tag: Copy> From> for OpTy<'tcx, Tag> { } } -impl<'tcx, Tag> From> for OpTy<'tcx, Tag> { +impl<'tcx, Tag, Sym> From> for OpTy<'tcx, Tag, Sym> { #[inline(always)] fn from(val: ImmTy<'tcx, Tag>) -> Self { OpTy {