Skip to main content

Module synthetic_items

Module synthetic_items 

Source

Structs§

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

Enums§

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.

Functions§

lifetime_param_name 🔒
type_param_name 🔒