Skip to content

Commit 7a209bb

Browse files
committed
Justify untracked access.
1 parent c5628a5 commit 7a209bb

File tree

1 file changed

+1
-0
lines changed
  • compiler/rustc_middle/src/hir

1 file changed

+1
-0
lines changed

compiler/rustc_middle/src/hir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pub fn provide(providers: &mut Providers) {
7171
};
7272
providers.hir_owner_nodes = |tcx, id| tcx.hir_crate(()).owners[id].as_ref().map(|i| &i.nodes);
7373
providers.hir_owner_parent = |tcx, id| {
74+
// Accessing the def_key is ok since its value is hashed as part of `id`'s DefPathHash.
7475
let parent = tcx.untracked_resolutions.definitions.def_key(id).parent;
7576
let parent = parent.map_or(CRATE_HIR_ID, |local_def_index| {
7677
let def_id = LocalDefId { local_def_index };

0 commit comments

Comments
 (0)