[][src]Enum rustc_target::abi::DiscriminantKind

pub enum DiscriminantKind {
    Tag,
    Niche {
        dataful_variant: VariantIdx,
        niche_variants: RangeInclusive<VariantIdx>,
        niche_start: u128,
    },
}

Variants

Tag

Integer tag holding the discriminant value itself.

Niche

Niche (values invalid for a type) encoding the discriminant: the variant dataful_variant contains a niche at an arbitrary offset (field discr_index 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 Niche

dataful_variant: VariantIdxniche_variants: RangeInclusive<VariantIdx>niche_start: u128

Trait Implementations

impl Eq for DiscriminantKind[src]

impl PartialEq<DiscriminantKind> for DiscriminantKind[src]

impl Hash for DiscriminantKind[src]

impl Debug for DiscriminantKind[src]

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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

impl<T> Erased for T[src]

impl<E> SpecializationError for E[src]

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