pub fn mplace_array_fields(
        &self,
        base: MPlaceTy<'tcx>,
    ) -> EvalResult<'tcx, impl Iterator<Item=EvalResult<'tcx, MPlaceTy<'tcx>>> + 'a> {
        let len = base.len();
        let stride = match base.layout.fields {
            layout::FieldPlacement::Array { stride, .. } => stride,
            _ => bug!("mplace_array_fields: expected an array layout"),
        };
        let layout = base.layout.field(self, 0)?;
        let dl = &self.tcx.data_layout;
        Ok((0..len).map(move |i| {
            let ptr = base.ptr.ptr_offset(i * stride, dl)?;
            Ok(MPlaceTy {
                mplace: MemPlace { ptr, align: base.align, extra: PlaceExtra::None },
                layout
            })
        }))
    }
// Iterates over all fields of an array. Much more efficient than doing the
// same by repeatedly calling `mplace_array`.
Iterates over all fields of an array. Much more efficient than doing the
same by repeatedly calling `mplace_array`.
Iterates over all fields of an array . Much more efficient than doing the same by repeatedly calling ` mplace_array ` .
pub fn mplace_array_fields(
        &self,
        base: MPlaceTy<'tcx>,
    ) -> EvalResult<'tcx, impl Iterator<Item=EvalResult<'tcx, MPlaceTy<'tcx>>> + 'a> {
        let len = base.len();
        let stride = match base.layout.fields {
            layout::FieldPlacement::Array { stride, .. } => stride,
            _ => bug!("mplace_array_fields: expected an array layout"),
        };
        let layout = base.layout.field(self, 0)?;
        let dl = &self.tcx.data_layout;
        Ok((0..len).map(move |i| {
            let ptr = base.ptr.ptr_offset(i * stride, dl)?;
            Ok(MPlaceTy {
                mplace: MemPlace { ptr, align: base.align, extra: PlaceExtra::None },
                layout
            })
        }))
    }
pub fn mplace_array_fields ( & self , base : MPlaceTy < ' tcx > , ) -> EvalResult < ' tcx , impl Iterator < Item = EvalResult < ' tcx , MPlaceTy < ' tcx > > > + ' a > { let len = base . len ( ) ; let stride = match base . layout . fields { layout :: FieldPlacement :: Array { stride , .. } => stride , _ => bug ! ( " " ) , } ; let layout = base . layout . field ( self , 0 ) ? ; let dl = & self . tcx . data_layout ; Ok ( ( 0 .. len ) . map ( move | i | { let ptr = base . ptr . ptr_offset ( i * stride , dl ) ? ; Ok ( MPlaceTy { mplace : MemPlace { ptr , align : base . align , extra : PlaceExtra :: None } , layout } ) } ) ) }
Iterates over all fields of an array.
Iterates over all fields of an array .
&self
base
MPlaceTy<'tcx>