Skip to main content

FullDefKind

Enum FullDefKind 

Source
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

§param_env: ParamEnv
§adt_kind: AdtKind
§flags: AdtFlags
§destruct_impl: Box<VirtualTraitImpl>

Info required to construct a virtual Drop impl for this adt.

§

TyAlias

Type alias: type Foo = Bar;

Fields

§param_env: ParamEnv
§ty: Ty
§

ForeignTy

Type from an extern block.

§

AssocTy

Associated type: trait MyTrait { type Assoc; }

Fields

§param_env: ParamEnv
§implied_predicates: GenericPredicates
§associated_item: AssocItem
§value: Option<(Ty, Vec<ImplExpr>)>

The value for this associated type, along with proofs of the required predicates. If we’re in a trait decl, this has a value iff the type has a default; if we’re in a trait impl, this has a value iff the impl provides its own value for it.

§

OpaqueTy

Opaque type, aka impl Trait.

§

Trait

Fields

§param_env: ParamEnv
§implied_predicates: GenericPredicates
§self_predicate: TraitPredicate

The special Self: Trait clause.

§items: Vec<AssocItem>

Associated items, in definition order.

§dyn_self: Option<Ty>

dyn Trait<Args.., Ty = <Self as Trait>::Ty..> for this trait. This is Some iff this trait is dyn-compatible.

§

TraitAlias

Trait alias: trait IntIterator = Iterator<Item = i32>;

Fields

§param_env: ParamEnv
§implied_predicates: GenericPredicates
§self_predicate: TraitPredicate

The special Self: Trait clause.

§dyn_self: Option<Ty>

dyn Trait<Args.., Ty = <Self as Trait>::Ty..> for this trait. This is Some iff this trait is dyn-compatible.

§

TraitImpl

Fields

§param_env: ParamEnv
§trait_pred: TraitPredicate

The 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

§param_env: ParamEnv
§ty: Ty

The type to which this block applies.

§items: Vec<AssocItem>

Associated items, in definition order.

§

Fn

Fields

§param_env: ParamEnv
§inline: InlineAttr
§is_const: bool
§

AssocFn

Associated function: impl MyStruct { fn associated() {} } or trait Foo { fn associated() {} }

Fields

§param_env: ParamEnv
§associated_item: AssocItem
§inline: InlineAttr
§is_const: bool
§vtable_sig: Option<PolyFnSig>

The function signature when this method is used in a vtable. None if this method is not vtable safe. Some(sig) if it is vtable safe, where sig is the trait method declaration’s signature with Self replaced by dyn Trait and associated types normalized.

§

Closure

A closure, coroutine, or coroutine-closure.

Fields

§param_env: ParamEnv

This 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.

§is_const: bool
§inline: InlineAttr
§fn_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.

§call_once_sig: PolyFnSig

The signature of the call_once method.

§call_mut_sig: Option<PolyFnSig>

The signature of the call_mut method, if applicable.

§call_sig: Option<PolyFnSig>

The signature of the call method, if applicable.

§call_mut_vtable_sig: Option<PolyFnSig>

The signature of the call_mut method, if applicable, with Self replaced by dyn Trait (like vtable_sig in AssocFn).

§call_vtable_sig: Option<PolyFnSig>

The signature of the call method, if applicable, with Self replaced by dyn Trait (like vtable_sig in AssocFn).

§

Const

Fields

§param_env: ParamEnv
§ty: Ty
§

AssocConst

Associated constant: trait MyTrait { const ASSOC: usize; }

Fields

§param_env: ParamEnv
§associated_item: AssocItem
§ty: Ty
§

Static

Fields

§param_env: ParamEnv
§safety: Safety

Whether it’s a unsafe static, safe static (inside extern only) or just a static.

§mutability: Mutability

Whether it’s a static mut or just a static.

§nested: bool

Whether it’s an anonymous static generated for nested allocations.

§ty: Ty
§

ExternCrate

§

Use

§

Mod

Fields

§items: Vec<(Option<Ident>, DefId)>
§

ForeignMod

An extern block.

Fields

§items: Vec<DefId>
§

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

§adt_def_id: DefId
§ctor_of: CtorOf
§variant_id: VariantIdx
§output_ty: Ty
§

Field

A field in a struct, enum or union. e.g.

  • bar in struct Foo { bar: u8 }
  • Foo::Bar::0 in enum 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

Source§

fn clone(&self) -> FullDefKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FullDefKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<I, T> ExtractContext<I, ()> for T

§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<I> RecreateContext<I> for I

§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more