Pointer in rustc_middle::mir::interpret - Rust (original) (raw)

pub struct Pointer<Prov = CtfeProvenance> {
    pub(super) offset: Size,
    pub provenance: Prov,
}

Expand description

Represents a pointer in the Miri engine.

Pointers are “tagged” with provenance information; typically the AllocId they belong to.

Source§

Source

Convert this pointer that might have a provenance into a pointer that definitely has a provenance, or an absolute address.

This is rarely what you want; call ptr_try_get_alloc_id instead.

Source

Returns the absolute address the pointer points to. Only works if Prov::OFFSET_IS_ADDR is true!

Source§

Source

Creates a pointer to the given address, with invalid provenance (i.e., cannot be used for any memory access).

Source

Source§

Source

Source

Obtain the constituents of this pointer. Not that the meaning of the offset depends on the type Prov! This function must only be used in the implementation of Machine::ptr_get_alloc, and when a Pointer is taken apart to be stored efficiently in an Allocation.

Source

Source

Source

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.