Struct rustc_mir_dataflow::ty::AdtDef[−][src]

pub struct AdtDef {
    pub did: DefId,
    pub variants: IndexVec<VariantIdx, VariantDef>,
    flags: AdtFlags,
    pub repr: ReprOptions,
}
Expand description

The definition of a user-defined type, e.g., a struct, enum, or union.

These are all interned (by alloc_adt_def) into the global arena.

The initialism ADT stands for an algebraic data type (ADT). This is slightly wrong because unions are not ADTs. Moreover, Rust only allows recursive data types through indirection.

Fields

did: DefId

The DefId of the struct, enum or union item.

variants: IndexVec<VariantIdx, VariantDef>

Variants of the ADT. If this is a struct or union, then there will be a single variant.

flags: AdtFlags

Flags of the ADT (e.g., is this a struct? is this non-exhaustive?).

repr: ReprOptions

Repr options provided by the user.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

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: 56 bytes