[][src]Enum rustc_mir::interpret::Immediate

pub enum Immediate<Tag = (), Id = AllocId> {
    Scalar(ScalarMaybeUndef<Tag, Id>),
    ScalarPair(ScalarMaybeUndef<Tag, Id>, ScalarMaybeUndef<Tag, 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.

An Immediate represents a single immediate self-contained Rust value.

For optimization of a few very common cases, there is also a representation for a pair of primitive values (ScalarPair). It allows Miri to avoid making allocations for checked binary operations and wide pointers. This idea was taken from rustc's codegen. In particular, thanks to ScalarPair, arithmetic operations and casts can be entirely defined on Immediate, and do not have to work with a Place.

Variants

Scalar(ScalarMaybeUndef<Tag, 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.

ScalarPair(ScalarMaybeUndef<Tag, Id>, ScalarMaybeUndef<Tag, 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.

Methods

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

pub fn new_slice(val: Scalar<Tag>, len: u64, 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 new_dyn_trait(val: Scalar<Tag>, vtable: Pointer<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 to_scalar_or_undef(self) -> ScalarMaybeUndef<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.

pub fn to_scalar(self) -> InterpResult<'tcx, Scalar<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.

pub fn to_scalar_pair(self) -> InterpResult<'tcx, (Scalar<Tag>, Scalar<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.

Trait Implementations

impl<'a, Ctx> Snapshot<'a, Ctx> for Immediate where
    Ctx: SnapshotContext<'a>, 
[src]

type Item = Immediate<(), AllocIdSnapshot<'a>>

⚙️ 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<Tag> From<ScalarMaybeUndef<Tag, AllocId>> for Immediate<Tag>[src]

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

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

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

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

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

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

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

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

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

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

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

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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 = !

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.

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

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

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

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> ArenaAllocatable for T where
    T: Copy
[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<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

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