[−][src]Enum rustc_target::abi::Variants
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: Scalar
variants: 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: VariantIdx
niche_variants: RangeInclusive<VariantIdx>
niche: Scalar
niche_start: u128
variants: IndexVec<VariantIdx, LayoutDetails>
Trait Implementations
impl Eq for Variants
[src]
impl PartialEq<Variants> for Variants
[src]
impl Debug for Variants
[src]
impl Hash for Variants
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<E> SpecializationError for E
[src]
impl<T> Erased for T
[src]
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,