Struct rustc_const_eval::interpret::place::MemPlace
source · pub(super) struct MemPlace<Prov: Provenance = AllocId> {
pub ptr: Pointer<Option<Prov>>,
pub meta: MemPlaceMeta<Prov>,
misaligned: Option<Misalignment>,
}
Fields§
§ptr: Pointer<Option<Prov>>
The pointer can be a pure integer, with the None
provenance.
meta: MemPlaceMeta<Prov>
Metadata for unsized places. Interpretation is up to the type.
Must not be present for sized types, but can be missing for unsized types
(e.g., extern type
).
misaligned: Option<Misalignment>
Stores whether this place was created based on a sufficiently aligned pointer.
Implementations§
source§impl<Prov: Provenance> MemPlace<Prov>
impl<Prov: Provenance> MemPlace<Prov>
sourcepub fn map_provenance(
self,
f: impl FnOnce(Option<Prov>) -> Option<Prov>
) -> Self
pub fn map_provenance( self, f: impl FnOnce(Option<Prov>) -> Option<Prov> ) -> Self
Adjust the provenance of the main pointer (metadata is unaffected).
sourcepub fn to_ref(self, cx: &impl HasDataLayout) -> Immediate<Prov>
pub fn to_ref(self, cx: &impl HasDataLayout) -> Immediate<Prov>
Turn a mplace into a (thin or wide) pointer, as a reference, pointing to the same space.
fn offset_with_meta_<'mir, 'tcx, M: Machine<'mir, 'tcx, Provenance = Prov>>( self, offset: Size, mode: OffsetMode, meta: MemPlaceMeta<Prov>, ecx: &InterpCx<'mir, 'tcx, M> ) -> InterpResult<'tcx, Self>
Trait Implementations§
source§impl<Prov: PartialEq + Provenance> PartialEq for MemPlace<Prov>
impl<Prov: PartialEq + Provenance> PartialEq for MemPlace<Prov>
impl<Prov: Copy + Provenance> Copy for MemPlace<Prov>
impl<Prov: Eq + Provenance> Eq for MemPlace<Prov>
impl<Prov: Provenance> StructuralEq for MemPlace<Prov>
impl<Prov: Provenance> StructuralPartialEq for MemPlace<Prov>
Auto Trait Implementations§
impl<Prov> RefUnwindSafe for MemPlace<Prov>where
Prov: RefUnwindSafe,
impl<Prov> Send for MemPlace<Prov>where
Prov: Send,
impl<Prov> Sync for MemPlace<Prov>where
Prov: Sync,
impl<Prov> Unpin for MemPlace<Prov>where
Prov: Unpin,
impl<Prov> UnwindSafe for MemPlace<Prov>where
Prov: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.