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§
source§impl<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§
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§
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.