Struct rustc_const_eval::interpret::MemPlace
source · [−]pub struct MemPlace<Tag: Provenance = AllocId> {
pub ptr: Pointer<Option<Tag>>,
pub align: Align,
pub meta: MemPlaceMeta<Tag>,
}Fields
ptr: Pointer<Option<Tag>>The pointer can be a pure integer, with the None tag.
align: Alignmeta: MemPlaceMeta<Tag>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<Tag: Provenance> MemPlace<Tag>
impl<Tag: Provenance> MemPlace<Tag>
pub fn from_ptr(ptr: Pointer<Option<Tag>>, align: Align) -> Self
sourcepub fn map_provenance(self, f: impl FnOnce(Option<Tag>) -> Option<Tag>) -> Self
pub fn map_provenance(self, f: impl FnOnce(Option<Tag>) -> Option<Tag>) -> Self
Adjust the provenance of the main pointer (metadata is unaffected).
sourcepub fn to_ref(self, cx: &impl HasDataLayout) -> Immediate<Tag>
pub fn to_ref(self, cx: &impl HasDataLayout) -> Immediate<Tag>
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<'tcx>(
self,
offset: Size,
meta: MemPlaceMeta<Tag>,
cx: &impl HasDataLayout
) -> InterpResult<'tcx, Self>
Trait Implementations
sourceimpl<Tag: Clone + Provenance> Clone for MemPlace<Tag>
impl<Tag: Clone + Provenance> Clone for MemPlace<Tag>
sourceimpl<Tag: Debug + Provenance> Debug for MemPlace<Tag>
impl<Tag: Debug + Provenance> Debug for MemPlace<Tag>
sourceimpl<Tag: Hash + Provenance> Hash for MemPlace<Tag>
impl<Tag: Hash + Provenance> Hash for MemPlace<Tag>
sourceimpl<'__ctx, Tag: Provenance> HashStable<StableHashingContext<'__ctx>> for MemPlace<Tag> where
Tag: HashStable<StableHashingContext<'__ctx>>,
impl<'__ctx, Tag: Provenance> HashStable<StableHashingContext<'__ctx>> for MemPlace<Tag> where
Tag: HashStable<StableHashingContext<'__ctx>>,
fn hash_stable(
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)
impl<Tag: Copy + Provenance> Copy for MemPlace<Tag>
impl<Tag: Eq + Provenance> Eq for MemPlace<Tag>
impl<Tag: Provenance> StructuralEq for MemPlace<Tag>
impl<Tag: Provenance> StructuralPartialEq for MemPlace<Tag>
Auto Trait Implementations
impl<Tag> RefUnwindSafe for MemPlace<Tag> where
Tag: RefUnwindSafe,
impl<Tag> Send for MemPlace<Tag> where
Tag: Send,
impl<Tag> Sync for MemPlace<Tag> where
Tag: Sync,
impl<Tag> Unpin for MemPlace<Tag> where
Tag: Unpin,
impl<Tag> UnwindSafe for MemPlace<Tag> where
Tag: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. 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.