[][src]Struct rustc::mir::interpret::Pointer

pub struct Pointer<Tag = (), Id = AllocId> {
    pub alloc_id: Id,
    pub offset: Size,
    pub tag: Tag,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Pointer is generic over the type that represents a reference to Allocations, thus making it possible for the most convenient representation to be used in each context.

Defaults to the index based and loosely coupled AllocId.

Pointer is also generic over the Tag associated with each pointer, which is used to do provenance tracking during execution.

Fields

alloc_id: Id
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

offset: Size
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

tag: Tag
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Methods

impl Pointer<()>[src]

pub fn new(alloc_id: AllocId, offset: Size) -> Self[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn with_tag<Tag>(self, tag: Tag) -> Pointer<Tag>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'tcx, Tag> Pointer<Tag>[src]

pub fn new_with_tag(alloc_id: AllocId, offset: Size, tag: Tag) -> Self[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn offset(
    self,
    i: Size,
    cx: &impl HasDataLayout
) -> InterpResult<'tcx, Self>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn overflowing_offset(
    self,
    i: Size,
    cx: &impl HasDataLayout
) -> (Self, bool)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn wrapping_offset(self, i: Size, cx: &impl HasDataLayout) -> Self[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn signed_offset(
    self,
    i: i64,
    cx: &impl HasDataLayout
) -> InterpResult<'tcx, Self>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn overflowing_signed_offset(
    self,
    i: i128,
    cx: &impl HasDataLayout
) -> (Self, bool)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn wrapping_signed_offset(self, i: i64, cx: &impl HasDataLayout) -> Self[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn erase_tag(self) -> Pointer[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn check_inbounds_alloc(
    self,
    allocation_size: Size,
    msg: CheckInAllocMsg
) -> InterpResult<'tcx, ()>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Test if the pointer is "inbounds" of an allocation of the given size. A pointer is "inbounds" even if its offset is equal to the size; this is a "one-past-the-end" pointer.

Trait Implementations

impl<Tag: Clone, Id: Clone> Clone for Pointer<Tag, Id>[src]

impl<Tag: Copy, Id: Copy> Copy for Pointer<Tag, Id>[src]

impl<Tag: Debug, Id: Debug> Debug for Pointer<Tag, Id>[src]

impl<Id: Debug> Debug for Pointer<(), Id>[src]

impl<Tag: Decodable, Id: Decodable> Decodable for Pointer<Tag, Id>[src]

impl<Tag: Encodable, Id: Encodable> Encodable for Pointer<Tag, Id>[src]

impl<Tag: Eq, Id: Eq> Eq for Pointer<Tag, Id>[src]

impl From<AllocId> for Pointer[src]

Produces a Pointer that points to the beginning of the Allocation.

impl<Tag> From<Pointer<Tag, AllocId>> for Scalar<Tag>[src]

impl<Tag> From<Pointer<Tag, AllocId>> for ScalarMaybeUndef<Tag>[src]

impl<Tag: Hash, Id: Hash> Hash for Pointer<Tag, Id>[src]

impl<'__ctx, Tag, Id> HashStable<StableHashingContext<'__ctx>> for Pointer<Tag, Id> where
    Id: HashStable<StableHashingContext<'__ctx>>,
    Tag: HashStable<StableHashingContext<'__ctx>>, 
[src]

impl<Tag: Ord, Id: Ord> Ord for Pointer<Tag, Id>[src]

impl<Tag: PartialEq, Id: PartialEq> PartialEq<Pointer<Tag, Id>> for Pointer<Tag, Id>[src]

impl<Tag: PartialOrd, Id: PartialOrd> PartialOrd<Pointer<Tag, Id>> for Pointer<Tag, Id>[src]

impl<Tag, Id> StructuralEq for Pointer<Tag, Id>[src]

impl<Tag, Id> StructuralPartialEq for Pointer<Tag, Id>[src]

Auto Trait Implementations

impl<Tag, Id> RefUnwindSafe for Pointer<Tag, Id> where
    Id: RefUnwindSafe,
    Tag: RefUnwindSafe

impl<Tag, Id> Send for Pointer<Tag, Id> where
    Id: Send,
    Tag: Send

impl<Tag, Id> Sync for Pointer<Tag, Id> where
    Id: Sync,
    Tag: Sync

impl<Tag, Id> Unpin for Pointer<Tag, Id> where
    Id: Unpin,
    Tag: Unpin

impl<Tag, Id> UnwindSafe for Pointer<Tag, Id> where
    Id: UnwindSafe,
    Tag: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ArenaAllocatable for T where
    T: Copy
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<E> SpecializationError for E[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.