VariantData in rustc_ast::ast - Rust (original) (raw)

pub enum VariantData {
    Struct {
        fields: ThinVec<FieldDef>,
        recovered: Recovered,
    },
    Tuple(ThinVec<FieldDef>, NodeId),
    Unit(NodeId),
}

Expand description

Fields and constructor ids of enum variants and structs.

§

Struct variant.

E.g., Bar { .. } as in enum Foo { Bar { .. } }.

Fields

§

Tuple variant.

E.g., Bar(..) as in enum Foo { Bar(..) }.

§

Unit variant.

E.g., Bar = .. as in enum Foo { Bar = .. }.

Source§

Source

Return the fields of this variant.

Source

Return the NodeId of this variant’s constructor, if it has one.

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 16 bytes

Size for each variant: