Skip to content

Commit

Permalink
Edit docs for rustc_hir::Definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
pierwill committed Nov 2, 2021
1 parent ec86a8f commit 8b48d70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_hir/src/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ impl DefPathTable {
pub struct Definitions {
table: DefPathTable,

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

0 comments on commit 8b48d70

Please sign in to comment.