Skip to main content

Module new

Module new 

Source
Expand description

This module contains type definitions that have no equivalent in Rustc.

Modules§

full_def 🔒
item_ref 🔒
synthetic_items 🔒

Structs§

Adt
ADts (Struct, Enum and Union map to this).
AssocConst
Associated constant: trait MyTrait { const ASSOC: usize; }
AssocFn
Associated function: impl MyStruct { fn associated() {} } or trait Foo { fn associated() {} }
AssocTy
Associated type: trait MyTrait { type Assoc; }
Closure
A closure, coroutine, or coroutine-closure.
Const
Ctor
The constructor function of a tuple/unit struct or tuple/unit enum variant.
Fn
FnPointer
FnPtrShape
Represents the “shape” of a function pointer, i.e. the most general signature we can obtain from it without breaking the higher-kinded variables. E.g. for<'a> fn(&'a u32) -> Adt<'a, u32> is considered to be an instantiation of the shape for<'a> fn(&'a A) -> Adt<'a, B> with A=B=u32.
ForeignMod
An extern block.
FullDef
Gathers a lot of definition information about a rustc_hir::def_id::DefId.
GenericParamDefIds
This is a pretty criminal hack: I want to generate ty::Generics for my fake items. This requires DefIds for the generic parameters. rustc has an affordance for creating new DefIds (tcx.create_def()) but I could not figure out a way to use it that didn’t end up ICEing during metadata encoding. So instead I’m reusing the DefIds of generic parameters from core functions.
ImplAssocItem
An associated item in a trait impl. This can be an item provided by the trait impl, or an item that reuses the trait decl default value.
ImplAssocItemValue
The item is provided by the trait impl.
InherentImpl
ItemRef
Reference to an item, with generics. Basically any mention of an item (function, type, etc) uses this.
ItemRefContents
Contents of ItemRef.
Mod
ParamEnv
The combination of type generics and related predicates.
Static
SyntheticItemData
Trait
TraitAlias
Trait alias: trait IntIterator = Iterator<Item = i32>;
TraitImpl
TraitItemBinder
The binding context to use when translating a trait impl associated item.
TyAlias
Type alias: type Foo = Bar;

Enums§

AssocTyKind
ConstKind
The kind of a constant item.
FullDefKind
Imbues rustc_hir::def::DefKind with a lot of extra information.
SyntheticItem
We create some extra DefIds to represent things that rustc doesn’t have a DefId for. This makes the pipeline much easier to have “real” def_ids for them, as we can then solve traits for them etc, and works well with monomorphization.
InlineAttr

Functions§

assoc_items_of
The associated items of the trait or inherent impl that owns s, in definition order.
gen_vtable_sig
The vtable signature of the method, along with the state of its container.
get_implied_predicates
get_param_env
get_self_predicate
get_trait_decl_dyn_self_ty
Generates a dyn Trait<Args.., Ty = <Self as Trait>::Ty..> type for this trait.
late_bound_for_def
lifetime_param_name
self_trait_ref
translate_full_def
Construct the FullDef for this item. If args is Some, the returned FullDef will be instantiated with the provided generics.
translate_full_def_kind
Construct the FullDefKind for this item.
type_param_name
vtable_sig_with_dyn_self
The signature of method_decl as stored in a vtable, i.e. with its Self type replaced by the given dyn Trait<..> type.