summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-11-11 12:10:09 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-11 13:02:37 +0000
commitd47424b8339e3c6f2e313ccc7bb08c6857d86e44 (patch)
tree70b3de7918d9cfea98ac63fd24e59bc7de3e8f3c /compiler/rustc_query_system
parentc42a4245cc8dac5da7386de68ec6a37a4f63b8ed (diff)
downloadrust-d47424b8339e3c6f2e313ccc7bb08c6857d86e44.tar.gz
rust-d47424b8339e3c6f2e313ccc7bb08c6857d86e44.zip
Hash spans when interning.
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/ich/hcx.rs39
1 files changed, 2 insertions, 37 deletions
diff --git a/compiler/rustc_query_system/src/ich/hcx.rs b/compiler/rustc_query_system/src/ich/hcx.rs
index 148eabb38e2..6378ec10875 100644
--- a/compiler/rustc_query_system/src/ich/hcx.rs
+++ b/compiler/rustc_query_system/src/ich/hcx.rs
@@ -49,15 +49,13 @@ pub(super) enum BodyResolver<'tcx> {
 
 impl<'a> StableHashingContext<'a> {
     #[inline]
-    fn new_with_or_without_spans(
+    pub fn new(
         sess: &'a Session,
         definitions: &'a Definitions,
         cstore: &'a dyn CrateStore,
         source_span: &'a IndexVec<LocalDefId, Span>,
-        always_ignore_spans: bool,
     ) -> Self {
-        let hash_spans_initial =
-            !always_ignore_spans && !sess.opts.unstable_opts.incremental_ignore_spans;
+        let hash_spans_initial = !sess.opts.unstable_opts.incremental_ignore_spans;
 
         StableHashingContext {
             body_resolver: BodyResolver::Forbidden,
@@ -72,33 +70,6 @@ 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 {
-        Self::new_with_or_without_spans(
-            sess,
-            definitions,
-            cstore,
-            source_span,
-            /*always_ignore_spans=*/ false,
-        )
-    }
-
-    #[inline]
-    pub fn ignore_spans(
-        sess: &'a Session,
-        definitions: &'a Definitions,
-        cstore: &'a dyn CrateStore,
-        source_span: &'a IndexVec<LocalDefId, Span>,
-    ) -> Self {
-        let always_ignore_spans = true;
-        Self::new_with_or_without_spans(sess, definitions, cstore, source_span, always_ignore_spans)
-    }
-
-    #[inline]
     pub fn without_hir_bodies(&mut self, f: impl FnOnce(&mut StableHashingContext<'_>)) {
         f(&mut StableHashingContext { body_resolver: BodyResolver::Ignore, ..self.clone() });
     }
@@ -202,10 +173,4 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
     }
 }
 
-impl<'a> rustc_data_structures::intern::InternedHashingContext for StableHashingContext<'a> {
-    fn with_def_path_and_no_spans(&mut self, f: impl FnOnce(&mut Self)) {
-        self.while_hashing_spans(false, f);
-    }
-}
-
 impl<'a> rustc_session::HashStableContext for StableHashingContext<'a> {}