[][src]Enum rustc_ap_rustc_target::abi::TagEncoding

pub enum TagEncoding {
    Direct,
    Niche {
        dataful_variant: VariantIdx,
        niche_variants: RangeInclusive<VariantIdx>,
        niche_start: u128,
    },
}

Variants

Direct

The tag directly stores the discriminant, but possibly with a smaller layout (so converting the tag to the discriminant can require sign extension).

Niche

Niche (values invalid for a type) encoding the discriminant: Discriminant and variant index coincide. The variant dataful_variant contains a niche at an arbitrary offset (field tag_field 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 TagEncoding[src]

impl Eq for TagEncoding[src]

impl Hash for TagEncoding[src]

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

impl PartialEq<TagEncoding> for TagEncoding[src]

impl StructuralEq for TagEncoding[src]

impl StructuralPartialEq for TagEncoding[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.