pub fn eval_operand(
        &mut self,
        mir_op: &mir::Operand<'tcx>,
        layout: Option<TyLayout<'tcx>>,
    ) -> EvalResult<'tcx, OpTy<'tcx>> {
        use rustc::mir::Operand::*;
        let op = match *mir_op {
            // FIXME: do some more logic on `move` to invalidate the old location
            Copy(ref place) |
            Move(ref place) =>
                self.eval_place_to_op(place, layout)?,

            Constant(ref constant) => {
                let layout = from_known_layout(layout, || {
                    let ty = self.monomorphize(mir_op.ty(self.mir(), *self.tcx), self.substs());
                    self.layout_of(ty)
                })?;
                let op = self.const_value_to_op(constant.literal.val)?;
                OpTy { op, layout }
            }
        };
        trace!("{:?}: {:?}", mir_op, *op);
        Ok(op)
    }
/// Evaluate the operand, returning a place where you can then find the data.
/// if you already know the layout, you can save two some table lookups
/// by passing it in here.
Evaluate the operand, returning a place where you can then find the data.
if you already know the layout, you can save two some table lookups
by passing it in here.
Evaluate the operand returning a place where you can then find the data . if you already know the layout you can save two some table lookups by passing it in here .
pub fn eval_operand(
        &mut self,
        mir_op: &mir::Operand<'tcx>,
        layout: Option<TyLayout<'tcx>>,
    ) -> EvalResult<'tcx, OpTy<'tcx>> {
        use rustc::mir::Operand::*;
        let op = match *mir_op {
            // FIXME: do some more logic on `move` to invalidate the old location
            Copy(ref place) |
            Move(ref place) =>
                self.eval_place_to_op(place, layout)?,
            Constant(ref constant) => {
                let layout = from_known_layout(layout, || {
                    let ty = self.monomorphize(mir_op.ty(self.mir(), *self.tcx), self.substs());
                    self.layout_of(ty)
                })?;
                let op = self.const_value_to_op(constant.literal.val)?;
                OpTy { op, layout }
            }
        };
        trace!("{:?}: {:?}", mir_op, *op);
        Ok(op)
    }
pub fn eval_operand ( & mut self , mir_op : & mir :: Operand < ' tcx > , layout : Option < TyLayout < ' tcx > > , ) -> EvalResult < ' tcx , OpTy < ' tcx > > { use rustc :: mir :: Operand :: * ; let op = match * mir_op { // FIXME: do some more logic on `move` to invalidate the old location Copy ( ref place ) | Move ( ref place ) => self . eval_place_to_op ( place , layout ) ? , Constant ( ref constant ) => { let layout = from_known_layout ( layout , | | { let ty = self . monomorphize ( mir_op . ty ( self . mir ( ) , * self . tcx ) , self . substs ( ) ) ; self . layout_of ( ty ) } ) ? ; let op = self . const_value_to_op ( constant . literal . val ) ? ; OpTy { op , layout } } } ; trace ! ( " " mir_op op ) ; Ok ( op ) }
Evaluate the operand, returning a place where you can then find the data.
Evaluate the operand returning a place where you can then find the data .
&mut self
mir_op
&mir::Operand<'tcx>
layout
Option<TyLayout<'tcx>>