We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5628a5 commit 7a209bbCopy full SHA for 7a209bb
compiler/rustc_middle/src/hir/mod.rs
@@ -71,6 +71,7 @@ pub fn provide(providers: &mut Providers) {
71
};
72
providers.hir_owner_nodes = |tcx, id| tcx.hir_crate(()).owners[id].as_ref().map(|i| &i.nodes);
73
providers.hir_owner_parent = |tcx, id| {
74
+ // Accessing the def_key is ok since its value is hashed as part of `id`'s DefPathHash.
75
let parent = tcx.untracked_resolutions.definitions.def_key(id).parent;
76
let parent = parent.map_or(CRATE_HIR_ID, |local_def_index| {
77
let def_id = LocalDefId { local_def_index };
0 commit comments