diff --git a/compiler/rustc_middle/src/ich/impls_syntax.rs b/compiler/rustc_middle/src/ich/impls_syntax.rs index 1063b37be87e8..d932bfdee6ef6 100644 --- a/compiler/rustc_middle/src/ich/impls_syntax.rs +++ b/compiler/rustc_middle/src/ich/impls_syntax.rs @@ -4,7 +4,7 @@ use rustc_ast as ast; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_hir as hir; -use rustc_span::{SourceFile, Symbol, sym}; +use rustc_span::{Symbol, sym}; use smallvec::SmallVec; use super::StableHashingContext; @@ -54,56 +54,6 @@ fn is_ignored_attr(name: Symbol) -> bool { IGNORED_ATTRIBUTES.contains(&name) } -impl<'a> HashStable> for SourceFile { - fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { - let SourceFile { - name: _, // We hash the smaller stable_id instead of this - stable_id, - cnum, - // Do not hash the source as it is not encoded - src: _, - ref src_hash, - // Already includes src_hash, this is redundant - checksum_hash: _, - external_src: _, - start_pos: _, - normalized_source_len: _, - unnormalized_source_len: _, - lines: _, - ref multibyte_chars, - ref normalized_pos, - } = *self; - - stable_id.hash_stable(hcx, hasher); - - src_hash.hash_stable(hcx, hasher); - - { - // We are always in `Lines` form by the time we reach here. - assert!(self.lines.read().is_lines()); - let lines = self.lines(); - // We only hash the relative position within this source_file - lines.len().hash_stable(hcx, hasher); - for &line in lines.iter() { - line.hash_stable(hcx, hasher); - } - } - - // We only hash the relative position within this source_file - multibyte_chars.len().hash_stable(hcx, hasher); - for &char_pos in multibyte_chars.iter() { - char_pos.hash_stable(hcx, hasher); - } - - normalized_pos.len().hash_stable(hcx, hasher); - for &char_pos in normalized_pos.iter() { - char_pos.hash_stable(hcx, hasher); - } - - cnum.hash_stable(hcx, hasher); - } -} - impl<'tcx> HashStable> for rustc_feature::Features { fn hash_stable(&self, hcx: &mut StableHashingContext<'tcx>, hasher: &mut StableHasher) { // Unfortunately we cannot exhaustively list fields here, since the