Struct rustc_query_impl::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: DefIdThe 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: AdtFlagsFlags of the ADT (e.g., is this a struct? is this non-exhaustive?).
repr: ReprOptionsRepr options provided by the user.
Auto Trait Implementations
impl RefUnwindSafe for AdtDef
impl UnwindSafe for AdtDef
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
This method tries to recover the query key from the given DepNode,
something which is needed when forcing DepNodes during red-green
evaluation. The query system will only call this method if
fingerprint_style() is not FingerprintStyle::Opaque.
It is always valid to return None here, in which case incremental
compilation will treat the query as having changed instead of forcing it. Read more
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