Struct rustc_const_eval::interpret::place::MemPlace
source · pub(super) struct MemPlace<Prov: Provenance = AllocId> {
pub ptr: Pointer<Option<Prov>>,
pub meta: MemPlaceMeta<Prov>,
}
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
).
Implementations§
source§impl<Prov: Provenance> MemPlace<Prov>
impl<Prov: Provenance> MemPlace<Prov>
pub fn from_ptr(ptr: Pointer<Option<Prov>>) -> Self
pub fn from_ptr_with_meta( ptr: Pointer<Option<Prov>>, meta: MemPlaceMeta<Prov> ) -> Self
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_<'tcx>( self, offset: Size, meta: MemPlaceMeta<Prov>, cx: &impl HasDataLayout ) -> InterpResult<'tcx, Self>
Trait Implementations§
source§impl<Prov: PartialEq + Provenance> PartialEq<MemPlace<Prov>> for MemPlace<Prov>
impl<Prov: PartialEq + Provenance> PartialEq<MemPlace<Prov>> 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.