pub enum FullDefKind {
Show 28 variants
Adt {
param_env: ParamEnv,
adt_kind: AdtKind,
variants: IndexVec<VariantIdx, VariantDef>,
flags: AdtFlags,
repr: ReprOptions,
destruct_impl: Box<VirtualTraitImpl>,
},
TyAlias {
param_env: ParamEnv,
ty: Ty,
},
ForeignTy,
AssocTy {
param_env: ParamEnv,
implied_predicates: GenericPredicates,
associated_item: AssocItem,
value: Option<(Ty, Vec<ImplExpr>)>,
},
OpaqueTy,
Trait {
param_env: ParamEnv,
implied_predicates: GenericPredicates,
self_predicate: TraitPredicate,
items: Vec<AssocItem>,
dyn_self: Option<Ty>,
},
TraitAlias {
param_env: ParamEnv,
implied_predicates: GenericPredicates,
self_predicate: TraitPredicate,
dyn_self: Option<Ty>,
},
TraitImpl {
param_env: ParamEnv,
trait_pred: TraitPredicate,
dyn_self: Option<Ty>,
implied_impl_exprs: Vec<ImplExpr>,
items: Vec<ImplAssocItem>,
},
InherentImpl {
param_env: ParamEnv,
ty: Ty,
items: Vec<AssocItem>,
},
Fn {
param_env: ParamEnv,
inline: InlineAttr,
is_const: bool,
sig: PolyFnSig,
},
AssocFn {
param_env: ParamEnv,
associated_item: AssocItem,
inline: InlineAttr,
is_const: bool,
vtable_sig: Option<PolyFnSig>,
sig: PolyFnSig,
},
Closure {Show 13 fields
param_env: ParamEnv,
args: ClosureArgs,
is_const: bool,
inline: InlineAttr,
fn_once_impl: Box<VirtualTraitImpl>,
fn_mut_impl: Option<Box<VirtualTraitImpl>>,
fn_impl: Option<Box<VirtualTraitImpl>>,
destruct_impl: Box<VirtualTraitImpl>,
call_once_sig: PolyFnSig,
call_mut_sig: Option<PolyFnSig>,
call_sig: Option<PolyFnSig>,
call_mut_vtable_sig: Option<PolyFnSig>,
call_vtable_sig: Option<PolyFnSig>,
},
Const {
param_env: ParamEnv,
ty: Ty,
kind: ConstKind,
value: Option<ConstantExpr>,
},
AssocConst {
param_env: ParamEnv,
associated_item: AssocItem,
ty: Ty,
value: Option<ConstantExpr>,
},
Static {
param_env: ParamEnv,
safety: Safety,
mutability: Mutability,
nested: bool,
ty: Ty,
},
ExternCrate,
Use,
Mod {
items: Vec<(Option<Ident>, DefId)>,
},
ForeignMod {
items: Vec<DefId>,
},
TyParam,
ConstParam,
LifetimeParam,
Variant,
Ctor {
adt_def_id: DefId,
ctor_of: CtorOf,
variant_id: VariantIdx,
fields: IndexVec<FieldIdx, FieldDef>,
output_ty: Ty,
},
Field,
Macro(MacroKinds),
GlobalAsm,
SyntheticCoroutineBody,
}Expand description
Imbues rustc_hir::def::DefKind with a lot of extra information.
Variants§
Adt
ADts (Struct, Enum and Union map to this variant).
Fields
variants: IndexVec<VariantIdx, VariantDef>repr: ReprOptionsdestruct_impl: Box<VirtualTraitImpl>Info required to construct a virtual Drop impl for this adt.
TyAlias
Type alias: type Foo = Bar;
ForeignTy
Type from an extern block.
AssocTy
Associated type: trait MyTrait { type Assoc; }
Fields
implied_predicates: GenericPredicatesOpaqueTy
Opaque type, aka impl Trait.
Trait
Fields
implied_predicates: GenericPredicatesself_predicate: TraitPredicateThe special Self: Trait clause.
TraitAlias
Trait alias: trait IntIterator = Iterator<Item = i32>;
Fields
implied_predicates: GenericPredicatesself_predicate: TraitPredicateThe special Self: Trait clause.
TraitImpl
Fields
trait_pred: TraitPredicateThe trait that is implemented by this impl block.
dyn_self: Option<Ty>dyn Trait<Args.., Ty = <Self as Trait>::Ty..> for the implemented trait. This is
Some iff the trait is dyn-compatible.
implied_impl_exprs: Vec<ImplExpr>The ImplExprs required to satisfy the predicates on the trait declaration. E.g.:
trait Foo: Bar {}
impl Foo for () {} // would supply an `ImplExpr` for `Self: Bar`.items: Vec<ImplAssocItem>Associated items, in the order of the trait declaration. Includes defaulted items.
InherentImpl
Fields
Fn
AssocFn
Associated function: impl MyStruct { fn associated() {} } or trait Foo { fn associated() {} }
Fields
inline: InlineAttrClosure
A closure, coroutine, or coroutine-closure.
Fields
param_env: ParamEnvThis param env is empty because the (early-bound) generics of a closure are the same as those of the item in which it is defined. We hide the special weird generics that rustc uses internally for inference on closures.
args: ClosureArgsinline: InlineAttrfn_once_impl: Box<VirtualTraitImpl>Info required to construct a virtual FnOnce impl for this closure.
fn_mut_impl: Option<Box<VirtualTraitImpl>>Info required to construct a virtual FnMut impl for this closure.
fn_impl: Option<Box<VirtualTraitImpl>>Info required to construct a virtual Fn impl for this closure.
destruct_impl: Box<VirtualTraitImpl>Info required to construct a virtual Drop impl for this closure.
Const
AssocConst
Associated constant: trait MyTrait { const ASSOC: usize; }
Static
Fields
mutability: MutabilityWhether it’s a static mut or just a static.
ExternCrate
Use
Mod
ForeignMod
An extern block.
TyParam
Type parameter: the T in struct Vec<T> { ... }
ConstParam
Constant generic parameter: struct Foo<const N: usize> { ... }
LifetimeParam
Lifetime parameter: the 'a in struct Foo<'a> { ... }
Variant
Refers to the variant definition, DefKind::Ctor refers to its constructor if it exists.
Ctor
The constructor function of a tuple/unit struct or tuple/unit enum variant.
Fields
variant_id: VariantIdxField
A field in a struct, enum or union. e.g.
barinstruct Foo { bar: u8 }Foo::Bar::0inenum Foo { Bar(u8) }
Macro(MacroKinds)
Macros
GlobalAsm
A use of global_asm!.
SyntheticCoroutineBody
A synthetic coroutine body created by the lowering of a coroutine-closure, such as an async closure.
Trait Implementations§
Source§impl Clone for FullDefKind
impl Clone for FullDefKind
Source§fn clone(&self) -> FullDefKind
fn clone(&self) -> FullDefKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FullDefKind
impl RefUnwindSafe for FullDefKind
impl Send for FullDefKind
impl Sync for FullDefKind
impl Unpin for FullDefKind
impl UnwindSafe for FullDefKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more