diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-12-07 14:31:50 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-12-09 14:53:24 +0000 |
| commit | 1c1d3570ee9f160827fdb99208c5afb4ca0cd0f9 (patch) | |
| tree | 62304282adc4a8d012dd584d45904b68e65fdc15 /compiler/rustc_query_system/src | |
| parent | 2cd36f2c8902544371cfb6547be46842a8e7e314 (diff) | |
| download | rust-1c1d3570ee9f160827fdb99208c5afb4ca0cd0f9.tar.gz rust-1c1d3570ee9f160827fdb99208c5afb4ca0cd0f9.zip | |
Move the untracked cstore and source_span into a struct
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/ich/hcx.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/compiler/rustc_query_system/src/ich/hcx.rs b/compiler/rustc_query_system/src/ich/hcx.rs index 6378ec10875..1f55c254acc 100644 --- a/compiler/rustc_query_system/src/ich/hcx.rs +++ b/compiler/rustc_query_system/src/ich/hcx.rs @@ -7,8 +7,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_index::vec::IndexVec; -use rustc_session::cstore::CrateStore; +use rustc_session::cstore::Untracked; use rustc_session::Session; use rustc_span::source_map::SourceMap; use rustc_span::symbol::Symbol; @@ -21,8 +20,7 @@ use rustc_span::{BytePos, CachingSourceMapView, SourceFile, Span, SpanData, DUMM #[derive(Clone)] pub struct StableHashingContext<'a> { definitions: &'a Definitions, - cstore: &'a dyn CrateStore, - source_span: &'a IndexVec<LocalDefId, Span>, + untracked: &'a Untracked, // The value of `-Z incremental-ignore-spans`. // This field should only be used by `unstable_opts_incremental_ignore_span` incremental_ignore_spans: bool, @@ -49,19 +47,13 @@ pub(super) enum BodyResolver<'tcx> { impl<'a> StableHashingContext<'a> { #[inline] - pub fn new( - sess: &'a Session, - definitions: &'a Definitions, - cstore: &'a dyn CrateStore, - source_span: &'a IndexVec<LocalDefId, Span>, - ) -> Self { + pub fn new(sess: &'a Session, definitions: &'a Definitions, untracked: &'a Untracked) -> Self { let hash_spans_initial = !sess.opts.unstable_opts.incremental_ignore_spans; StableHashingContext { body_resolver: BodyResolver::Forbidden, definitions, - cstore, - source_span, + untracked, incremental_ignore_spans: sess.opts.unstable_opts.incremental_ignore_spans, caching_source_map: None, raw_source_map: sess.source_map(), @@ -100,7 +92,7 @@ impl<'a> StableHashingContext<'a> { if let Some(def_id) = def_id.as_local() { self.local_def_path_hash(def_id) } else { - self.cstore.def_path_hash(def_id) + self.untracked.cstore.def_path_hash(def_id) } } @@ -156,7 +148,7 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> { #[inline] fn def_span(&self, def_id: LocalDefId) -> Span { - *self.source_span.get(def_id).unwrap_or(&DUMMY_SP) + *self.untracked.source_span.get(def_id).unwrap_or(&DUMMY_SP) } #[inline] |
