Module rustc::hir::map::definitions [] [src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

For each definition, we track the following data. A definition here is defined somewhat circularly as "something with a def-id", but it generally corresponds to things like structs, enums, etc. There are also some rather random cases (like const initializer expressions) that are mostly just leftovers.

Structs

DefKey [
Experimental
]

A unique identifier that we can use to lookup a definition precisely. It combines the index of the definition's parent (if any) with a DisambiguatedDefPathData.

DefPath [
Experimental
]
DefPathHash [
Experimental
]
DefPathTable [
Experimental
]

The DefPathTable maps DefIndexes to DefKeys and vice versa. Internally the DefPathTable holds a tree of DefKeys, where each DefKey stores the DefIndex of its parent. There is one DefPathTable for each crate.

Definitions [
Experimental
]

The definition table containing node definitions. It holds the DefPathTable for local DefIds/DefPaths and it also stores a mapping from NodeIds to local DefIds.

DisambiguatedDefPathData [
Experimental
]

Pair of DefPathData and an integer disambiguator. The integer is normally 0, but in the event that there are multiple defs with the same parent and data, we use this field to disambiguate between them. This introduces some artificial ordering dependency but means that if you have (e.g.) two impls for the same type in the same module, they do get distinct def-ids.

Enums

DefPathData [
Experimental
]
GlobalMetaDataKind [
Experimental
]