diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-10-12 20:53:29 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-10-12 20:53:29 +0200 |
| commit | 7a209bb7a55580076ce77ae859330875f6e2f18c (patch) | |
| tree | 2a9d33100f95dbc1f75b4d4446dd020627fa3903 | |
| parent | c5628a5e656073bd3bceacb7824c2f66845d99f3 (diff) | |
| download | rust-7a209bb7a55580076ce77ae859330875f6e2f18c.tar.gz rust-7a209bb7a55580076ce77ae859330875f6e2f18c.zip | |
Justify untracked access.
| -rw-r--r-- | compiler/rustc_middle/src/hir/mod.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/hir/mod.rs b/compiler/rustc_middle/src/hir/mod.rs index 1648d0d3ac1..95d7273b17b 100644 --- a/compiler/rustc_middle/src/hir/mod.rs +++ b/compiler/rustc_middle/src/hir/mod.rs @@ -71,6 +71,7 @@ pub fn provide(providers: &mut Providers) { }; providers.hir_owner_nodes = |tcx, id| tcx.hir_crate(()).owners[id].as_ref().map(|i| &i.nodes); providers.hir_owner_parent = |tcx, id| { + // Accessing the def_key is ok since its value is hashed as part of `id`'s DefPathHash. let parent = tcx.untracked_resolutions.definitions.def_key(id).parent; let parent = parent.map_or(CRATE_HIR_ID, |local_def_index| { let def_id = LocalDefId { local_def_index }; |
