Struct rustc_const_eval::interpret::MemPlace
source · pub 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
sourceimpl<Prov: Provenance> MemPlace<Prov>
impl<Prov: Provenance> MemPlace<Prov>
pub fn from_ptr(ptr: Pointer<Option<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.
This is the inverse of ref_to_mplace
.
pub fn offset_with_meta<'tcx>(
self,
offset: Size,
meta: MemPlaceMeta<Prov>,
cx: &impl HasDataLayout
) -> InterpResult<'tcx, Self>
Trait Implementations
sourceimpl<Prov: Clone + Provenance> Clone for MemPlace<Prov>
impl<Prov: Clone + Provenance> Clone for MemPlace<Prov>
sourceimpl<Prov: Debug + Provenance> Debug for MemPlace<Prov>
impl<Prov: Debug + Provenance> Debug for MemPlace<Prov>
sourceimpl<Prov: Hash + Provenance> Hash for MemPlace<Prov>
impl<Prov: Hash + Provenance> Hash for MemPlace<Prov>
sourceimpl<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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn 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.