pub fn eval_place_to_op(
        &self,
        place: mir::Place<'tcx>,
        layout: Option<TyAndLayout<'tcx>>,
    ) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>> {
        // Do not use the layout passed in as argument if the base we are looking at
        // here is not the entire place.
        let layout = if place.projection.is_empty() { layout } else { None };

        let base_op = self.access_local(self.frame(), place.local, layout)?;

        let op = place
            .projection
            .iter()
            .try_fold(base_op, |op, elem| self.operand_projection(&op, elem))?;

        trace!("eval_place_to_op: got {:?}", *op);
        // Sanity-check the type we ended up with.
        debug_assert!(mir_assign_valid_types(
            *self.tcx,
            self.param_env,
            self.layout_of(self.subst_from_current_frame_and_normalize_erasing_regions(
                place.ty(&self.frame().body.local_decls, *self.tcx).ty
            ))?,
            op.layout,
        ));
        Ok(op)
    }
// Evaluate a place with the goal of reading from it.  This lets us sometimes
// avoid allocations.
Evaluate a place with the goal of reading from it.  This lets us sometimes
avoid allocations.
Evaluate a place with the goal of reading from it . This lets us sometimes avoid allocations .
pub fn eval_place_to_op(
        &self,
        place: mir::Place<'tcx>,
        layout: Option<TyAndLayout<'tcx>>,
    ) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>> {
        // Do not use the layout passed in as argument if the base we are looking at
        // here is not the entire place.
        let layout = if place.projection.is_empty() { layout } else { None };
        let base_op = self.access_local(self.frame(), place.local, layout)?;
        let op = place
            .projection
            .iter()
            .try_fold(base_op, |op, elem| self.operand_projection(&op, elem))?;
        trace!("eval_place_to_op: got {:?}", *op);
        // Sanity-check the type we ended up with.
        debug_assert!(mir_assign_valid_types(
            *self.tcx,
            self.param_env,
            self.layout_of(self.subst_from_current_frame_and_normalize_erasing_regions(
                place.ty(&self.frame().body.local_decls, *self.tcx).ty
            ))?,
            op.layout,
        ));
        Ok(op)
    }
pub fn eval_place_to_op ( & self , place : mir :: Place < ' tcx > , layout : Option < TyAndLayout < ' tcx > > , ) -> InterpResult < ' tcx , OpTy < ' tcx , M :: PointerTag > > { // Do not use the layout passed in as argument if the base we are looking at // here is not the entire place. let layout = if place . projection . is_empty ( ) { layout } else { None } ; let base_op = self . access_local ( self . frame ( ) , place . local , layout ) ? ; let op = place . projection . iter ( ) . try_fold ( base_op , | op , elem | self . operand_projection ( & op , elem ) ) ? ; trace ! ( " " op ) ; // Sanity-check the type we ended up with. debug_assert ! ( mir_assign_valid_types ( self tcx self param_env self layout_of ( self subst_from_current_frame_and_normalize_erasing_regions ( place ty ( self frame ( ) body local_decls self tcx ) ty ) ) op layout ) ) ; Ok ( op ) }
Evaluate a place with the goal of reading from it.
Evaluate a place with the goal of reading from it .
&self
place
mir::Place<'tcx>
layout
Option<TyAndLayout<'tcx>>
&self
place
mir::Place<'tcx>
layout
Option<TyAndLayout<'tcx>>