Struct rustc_hir::definitions::Definitions[][src]

pub struct Definitions {
    table: DefPathTable,
    pub(crate) def_id_to_hir_id: IndexVec<LocalDefId, Option<HirId>>,
    pub(crate) hir_id_to_def_id: FxHashMap<HirId, LocalDefId>,
    expansions_that_defined: FxHashMap<LocalDefId, ExpnId>,
Expand description

The definition table containing node definitions. It holds the DefPathTable for LocalDefIds/DefPaths. It also stores mappings to convert LocalDefIds to/from HirIds.


table: DefPathTabledef_id_to_hir_id: IndexVec<LocalDefId, Option<HirId>>hir_id_to_def_id: FxHashMap<HirId, LocalDefId>

The reverse mapping of def_id_to_hir_id.

expansions_that_defined: FxHashMap<LocalDefId, ExpnId>

Item with a given LocalDefId was defined during macro expansion with ID ExpnId.


Gets the number of definitions.

Returns the path from the crate root to index. The root nodes are not included in the path (i.e., this will be an empty vector for the crate root). For an inlined item, this will be the path of the item in the external crate (but the path will begin with the path to the external crate).

Adds a root definition (no parent) and a few other reserved definitions.

Retrieves the root definition.

Adds a definition with a parent definition.

Initializes the LocalDefId to HirId mapping once it has been generated during AST to HIR lowering.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.


Note: Most layout information is completely unstable and may be different between compiler versions and platforms. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 168 bytes