[][src]Enum rustc_target::abi::Variants

pub enum Variants {
    Single {
        index: VariantIdx,
    },
    Tagged {
        tag: Scalar,
        variants: IndexVec<VariantIdx, LayoutDetails>,
    },
    NicheFilling {
        dataful_variant: VariantIdx,
        niche_variants: RangeInclusive<VariantIdx>,
        niche: Scalar,
        niche_start: u128,
        variants: IndexVec<VariantIdx, LayoutDetails>,
    },
}

Variants

Single

Single enum variants, structs/tuples, unions, and all non-ADTs.

Fields of Single

index: VariantIdx
Tagged

General-case enums: for each case there is a struct, and they all have all space reserved for the tag, and their first field starts at a non-0 offset, after where the tag would go.

Fields of Tagged

tag: Scalarvariants: IndexVec<VariantIdx, LayoutDetails>
NicheFilling

Multiple cases distinguished by a niche (values invalid for a type): the variant dataful_variant contains a niche at an arbitrary offset (field 0 of the enum), which for a variant with discriminant d is set to (d - niche_variants.start).wrapping_add(niche_start).

For example, Option<(usize, &T)> is represented such that None has a null pointer for the second tuple field, and Some is the identity function (with a non-null reference).

Fields of NicheFilling

dataful_variant: VariantIdxniche_variants: RangeInclusive<VariantIdx>niche: Scalarniche_start: u128variants: IndexVec<VariantIdx, LayoutDetails>

Trait Implementations

impl PartialEq<Variants> for Variants[src]

impl Eq for Variants[src]

impl Hash for Variants[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Variants[src]

Auto Trait Implementations

impl Send for Variants

impl Sync for Variants

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

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

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