For each definition, we track the following data. A definition
here is defined somewhat circularly as “something with a
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.
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
DefPathHash is a fixed-size representation of a
DefPath that is
stable across crate and compilation session boundaries. It consists of two
separate 64-bit hashes. The first uniquely identifies the crate this
DefPathHash originates from (see StableCrateId), and the second
uniquely identifies the corresponding
DefPath within that crate. Together
they form a unique identifier within an entire crate graph.
DefKeys and vice versa.
DefPathTable holds a tree of
DefKeys, where each
DefIndex of its parent.
There is one
DefPathTable for each crate.
The definition table containing node definitions.
It holds the
It also stores mappings to convert
A pair of
DefPathData and an integer disambiguator. The integer is
0, but in the event that there are multiple defs with the
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