Variant in rustc_ast::ast - Rust (original) (raw)
pub struct Variant {
pub attrs: AttrVec,
pub id: NodeId,
pub span: Span,
pub vis: Visibility,
pub ident: Ident,
pub data: VariantData,
pub disr_expr: Option<AnonConst>,
pub is_placeholder: bool,
}
Expand description
Enum variant.
Attributes of the variant.
Id of the variant (not the constructor, see VariantData::ctor_id()
).
Span
The visibility of the variant. Syntactically accepted but not semantically.
Name of the variant.
Fields and constructor id of the variant.
Explicit discriminant, e.g., Foo = 1
.
Is a macro placeholder.
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: 104 bytes