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

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

Variants

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

Fields of Single

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

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

Trait Implementations

impl PartialEq for Variants
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Variants
[src]

impl Hash for Variants
[src]

Feeds this value into the given [Hasher]. Read more

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

impl Debug for Variants
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Variants

impl Sync for Variants