diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2022-01-05 10:30:49 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2022-01-05 10:30:49 -0500 |
| commit | 4ca275add0b443a3fe9f3a0fc4470bb9d9628cfd (patch) | |
| tree | 57d6016282be013ceaf11b85016162bcc2b6c862 | |
| parent | 560c90f5df4ecfbb75e20ae19bf10028756a3613 (diff) | |
| download | rust-4ca275add0b443a3fe9f3a0fc4470bb9d9628cfd.tar.gz rust-4ca275add0b443a3fe9f3a0fc4470bb9d9628cfd.zip | |
Address review comments
| -rw-r--r-- | compiler/rustc_query_system/src/ich/hcx.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_query_system/src/ich/hcx.rs b/compiler/rustc_query_system/src/ich/hcx.rs index 6838a32c7b3..76e21be17bc 100644 --- a/compiler/rustc_query_system/src/ich/hcx.rs +++ b/compiler/rustc_query_system/src/ich/hcx.rs @@ -27,7 +27,9 @@ fn compute_ignored_attr_names() -> FxHashSet<Symbol> { pub struct StableHashingContext<'a> { definitions: &'a Definitions, cstore: &'a dyn CrateStore, - sess: &'a Session, + // The value of `-Z incremental-ignore-spans`. + // This field should only be used by `debug_opts_incremental_ignore_span` + incremental_ignore_spans: bool, pub(super) body_resolver: BodyResolver<'a>, // Very often, we are hashing something that does not need the // `CachingSourceMapView`, so we initialize it lazily. @@ -64,7 +66,7 @@ impl<'a> StableHashingContext<'a> { body_resolver: BodyResolver::Forbidden, definitions, cstore, - sess, + incremental_ignore_spans: sess.opts.debugging_opts.incremental_ignore_spans, caching_source_map: None, raw_source_map: sess.source_map(), hashing_controls: HashingControls { @@ -181,6 +183,7 @@ impl<'a> StableHashingContext<'a> { IGNORED_ATTRIBUTES.with(|attrs| attrs.contains(&name)) } + #[inline] pub fn hashing_controls(&self) -> HashingControls { self.hashing_controls.clone() } @@ -201,7 +204,7 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> { #[inline] fn debug_opts_incremental_ignore_spans(&self) -> bool { - self.sess.opts.debugging_opts.incremental_ignore_spans + self.incremental_ignore_spans } #[inline] |
