fn eval_place_to_op(
        &mut self,
        mir_place: &mir::Place<'tcx>,
        layout: Option<TyLayout<'tcx>>,
    ) -> EvalResult<'tcx, OpTy<'tcx>> {
        use rustc::mir::Place::*;
        Ok(match *mir_place {
            Local(mir::RETURN_PLACE) => return err!(ReadFromReturnPointer),
            Local(local) => {
                let op = *self.frame().locals[local].access()?;
                let layout = from_known_layout(layout,
                    || self.layout_of_local(self.cur_frame(), local))?;
                OpTy { op, layout }
            },

            Projection(ref proj) => {
                let op = self.eval_place_to_op(&proj.base, None)?;
                self.operand_projection(op, &proj.elem)?
            }

            // Everything else is an mplace, so we just call `eval_place`.
            // Note that getting an mplace for a static aways requires `&mut`,
            // so this does not "cost" us anything in terms if mutability.
            Promoted(_) | Static(_) => {
                let place = self.eval_place(mir_place)?;
                place.to_mem_place().into()
            }
        })
    }
// Evaluate a place with the goal of reading from it.  This lets us sometimes
// avoid allocations.  If you already know the layout, you can pass it in
// to avoid looking it up again.
Evaluate a place with the goal of reading from it.  This lets us sometimes
avoid allocations.  If you already know the layout, you can pass it in
to avoid looking it up again.
Evaluate a place with the goal of reading from it . This lets us sometimes avoid allocations . If you already know the layout you can pass it in to avoid looking it up again .
fn eval_place_to_op(
        &mut self,
        mir_place: &mir::Place<'tcx>,
        layout: Option<TyLayout<'tcx>>,
    ) -> EvalResult<'tcx, OpTy<'tcx>> {
        use rustc::mir::Place::*;
        Ok(match *mir_place {
            Local(mir::RETURN_PLACE) => return err!(ReadFromReturnPointer),
            Local(local) => {
                let op = *self.frame().locals[local].access()?;
                let layout = from_known_layout(layout,
                    || self.layout_of_local(self.cur_frame(), local))?;
                OpTy { op, layout }
            },
            Projection(ref proj) => {
                let op = self.eval_place_to_op(&proj.base, None)?;
                self.operand_projection(op, &proj.elem)?
            }
            // Everything else is an mplace, so we just call `eval_place`.
            // Note that getting an mplace for a static aways requires `&mut`,
            // so this does not "cost" us anything in terms if mutability.
            Promoted(_) | Static(_) => {
                let place = self.eval_place(mir_place)?;
                place.to_mem_place().into()
            }
        })
    }
fn eval_place_to_op ( & mut self , mir_place : & mir :: Place < ' tcx > , layout : Option < TyLayout < ' tcx > > , ) -> EvalResult < ' tcx , OpTy < ' tcx > > { use rustc :: mir :: Place :: * ; Ok ( match * mir_place { Local ( mir :: RETURN_PLACE ) => return err ! ( ReadFromReturnPointer ) , Local ( local ) => { let op = * self . frame ( ) . locals [ local ] . access ( ) ? ; let layout = from_known_layout ( layout , | | self . layout_of_local ( self . cur_frame ( ) , local ) ) ? ; OpTy { op , layout } } , Projection ( ref proj ) => { let op = self . eval_place_to_op ( & proj . base , None ) ? ; self . operand_projection ( op , & proj . elem ) ? } // Everything else is an mplace, so we just call `eval_place`. // Note that getting an mplace for a static aways requires `&mut`, // so this does not "cost" us anything in terms if mutability. Promoted ( _ ) | Static ( _ ) => { let place = self . eval_place ( mir_place ) ? ; place . to_mem_place ( ) . into ( ) } } ) }
Evaluate a place with the goal of reading from it.
Evaluate a place with the goal of reading from it .
&mut self
mir_place
&mir::Place<'tcx>
layout
Option<TyLayout<'tcx>>