Expand description
This file governs the overall translation of items.
Translation works as follows: we translate each TransItemSource of interest into an
appropriate item. In the process of translating an item we may find more hax::DefIds of
interest; we register those as an appropriate TransItemSource, which will 1/ enqueue the item
so that it eventually gets translated too, and 2/ return an ItemId we can use to refer to
it.
We start with the DefId of the current crate (or of anything passed to --start-from) and
recursively translate everything we find.
There’s another important component at play: opacity. Each item is assigned an opacity based on
its name. By default, items from the local crate are transparent and items from foreign crates
are opaque (this can be controlled with --include, --opaque and --exclude). If an item is
opaque, its signature/“outer shell” will be translated (e.g. for functions that’s the
signature) but not its contents.
Structs§
- Trans
Item Source - The id of an untranslated item. Note that a given
DefIdmay show up as multiple different item sources, e.g. a constant will have both aGlobalversion (for the constant itself) and aFunDeclone (for its initializer function).
Enums§
- Rustc
Item - Refers to a rustc item. Can be either the polymorphic version of the item, or a monomorphization of it.
- Trait
Impl Source - The kind of a
TransItemSourceKind::TraitImpl. - Trans
Item Source Kind - The kind of a
TransItemSource.