Skip to content

Commit 8b48d70

Browse files
committed
Edit docs for rustc_hir::Definitions
1 parent ec86a8f commit 8b48d70

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_hir/src/definitions.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ impl DefPathTable {
101101
pub struct Definitions {
102102
table: DefPathTable,
103103

104-
// FIXME(eddyb) ideally all `LocalDefId`s would be HIR owners.
104+
/// Only [`LocalDefId`]s for items and item-like are HIR owners.
105+
/// The associated [`HirId`] has a `local_id` of `0`.
106+
/// Generic parameters and closures are also assigned a `LocalDefId` but are not HIR owners.
107+
/// Their `HirId`s are defined by their position while lowering the enclosing owner.
108+
// FIXME(cjgillot) Some `LocalDefId`s from `use` items are dropped during lowering and lack a `HirId`.
105109
pub(super) def_id_to_hir_id: IndexVec<LocalDefId, Option<hir::HirId>>,
106110
/// The reverse mapping of `def_id_to_hir_id`.
107111
pub(super) hir_id_to_def_id: FxHashMap<hir::HirId, LocalDefId>,

0 commit comments

Comments
 (0)