Skip to main content

FullDefKind

Enum FullDefKind 

Source
pub enum FullDefKind<'tcx> {
Show 30 variants Adt(Adt<'tcx>), TyAlias(TyAlias<'tcx>), ForeignTy, AssocTy(AssocTy<'tcx>), OpaqueTy, Trait(Trait<'tcx>), TraitAlias(TraitAlias<'tcx>), TraitImpl(TraitImpl<'tcx>), InherentImpl(InherentImpl<'tcx>), Fn(Fn<'tcx>), FnPtr(FnPointer<'tcx>), AssocFn(AssocFn<'tcx>), Closure(Closure<'tcx>), Const(Const<'tcx>), AssocConst(AssocConst<'tcx>), Static(Static<'tcx>), ExternCrate, Use, Mod(Mod), ForeignMod(ForeignMod), TyParam, ConstParam, LifetimeParam, Variant, Ctor(Ctor<'tcx>), Field, Macro, GlobalAsm, SyntheticCoroutineBody, TestBinderConstraints,
}
Expand description

Imbues rustc_hir::def::DefKind with a lot of extra information.

Variants§

§

Adt(Adt<'tcx>)

ADts (Struct, Enum and Union map to this variant).

§

TyAlias(TyAlias<'tcx>)

Type alias: type Foo = Bar;

§

ForeignTy

Type from an extern block.

§

AssocTy(AssocTy<'tcx>)

Associated type: trait MyTrait { type Assoc; }

§

OpaqueTy

Opaque type, aka impl Trait.

§

Trait(Trait<'tcx>)

§

TraitAlias(TraitAlias<'tcx>)

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

§

TraitImpl(TraitImpl<'tcx>)

§

InherentImpl(InherentImpl<'tcx>)

§

Fn(Fn<'tcx>)

§

FnPtr(FnPointer<'tcx>)

Synthetic item representing a particular shape of function pointer types. E.g. for<'a> fn(&'a u32) -> Adt<'a, u32> is considered to be an instantiation of the fake item for<'a> fn(&'a A) -> Adt<'a, B> with A=B=u32. Note how the item can therefore have trait clauses if some Adt does.

§

AssocFn(AssocFn<'tcx>)

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

§

Closure(Closure<'tcx>)

A closure, coroutine, or coroutine-closure.

§

Const(Const<'tcx>)

§

AssocConst(AssocConst<'tcx>)

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

§

Static(Static<'tcx>)

§

ExternCrate

§

Use

§

Mod(Mod)

§

ForeignMod(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(Ctor<'tcx>)

The constructor function of a tuple/unit struct or tuple/unit enum variant.

§

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

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.

§

TestBinderConstraints

Trait Implementations§

Source§

impl<'tcx> Clone for FullDefKind<'tcx>

Source§

fn clone(&self) -> FullDefKind<'tcx>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'tcx> Debug for FullDefKind<'tcx>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'tcx> !DynSync for FullDefKind<'tcx>

§

impl<'tcx> !Freeze for FullDefKind<'tcx>

§

impl<'tcx> !RefUnwindSafe for FullDefKind<'tcx>

§

impl<'tcx> !Sync for FullDefKind<'tcx>

§

impl<'tcx> !UnwindSafe for FullDefKind<'tcx>

§

impl<'tcx> DynSend for FullDefKind<'tcx>

§

impl<'tcx> Send for FullDefKind<'tcx>

§

impl<'tcx> Unpin for FullDefKind<'tcx>

§

impl<'tcx> UnsafeUnpin for FullDefKind<'tcx>

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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