[][src]Enum rustc_ap_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 Debug for DiscriminantKind[src]

impl Eq for DiscriminantKind[src]

impl Hash for DiscriminantKind[src]

impl<__CTX> HashStable<__CTX> for DiscriminantKind where
    __CTX: HashStableContext
[src]

impl PartialEq<DiscriminantKind> for DiscriminantKind[src]

impl StructuralEq for DiscriminantKind[src]

impl StructuralPartialEq for DiscriminantKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[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<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 = !

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<E> SpecializationError for E[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.