]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_query_system/src/ich/hcx.rs
Auto merge of #106081 - mina86:c, r=Mark-Simulacrum
[rust.git] / compiler / rustc_query_system / src / ich / hcx.rs
index 1f55c254acc936587b2ac25823385e6dfba70899..163da59edd5c7378fe43f9f8c565ae1237d72693 100644 (file)
@@ -6,7 +6,7 @@
 use rustc_data_structures::sync::Lrc;
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, LocalDefId};
-use rustc_hir::definitions::{DefPathHash, Definitions};
+use rustc_hir::definitions::DefPathHash;
 use rustc_session::cstore::Untracked;
 use rustc_session::Session;
 use rustc_span::source_map::SourceMap;
@@ -19,7 +19,6 @@
 /// things (e.g., each `DefId`/`DefPath` is only hashed once).
 #[derive(Clone)]
 pub struct StableHashingContext<'a> {
-    definitions: &'a Definitions,
     untracked: &'a Untracked,
     // The value of `-Z incremental-ignore-spans`.
     // This field should only be used by `unstable_opts_incremental_ignore_span`
@@ -47,12 +46,11 @@ pub(super) enum BodyResolver<'tcx> {
 
 impl<'a> StableHashingContext<'a> {
     #[inline]
-    pub fn new(sess: &'a Session, definitions: &'a Definitions, untracked: &'a Untracked) -> Self {
+    pub fn new(sess: &'a Session, untracked: &'a Untracked) -> Self {
         let hash_spans_initial = !sess.opts.unstable_opts.incremental_ignore_spans;
 
         StableHashingContext {
             body_resolver: BodyResolver::Forbidden,
-            definitions,
             untracked,
             incremental_ignore_spans: sess.opts.unstable_opts.incremental_ignore_spans,
             caching_source_map: None,
@@ -98,7 +96,7 @@ pub fn def_path_hash(&self, def_id: DefId) -> DefPathHash {
 
     #[inline]
     pub fn local_def_path_hash(&self, def_id: LocalDefId) -> DefPathHash {
-        self.definitions.def_path_hash(def_id)
+        self.untracked.definitions.read().def_path_hash(def_id)
     }
 
     #[inline]