Skip to content

Commit a135a5a

Browse files
authored
Rollup merge of #154743 - nnethercote:rm-two-unused-HashStable-impls, r=TaKO8Ki
Remove an unused `StableHash` impl. r? @TaKO8Ki
2 parents 8517ff5 + c3d9f99 commit a135a5a

1 file changed

Lines changed: 1 addition & 51 deletions

File tree

compiler/rustc_middle/src/ich/impls_syntax.rs

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use rustc_ast as ast;
55
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
66
use rustc_hir as hir;
7-
use rustc_span::{SourceFile, Symbol, sym};
7+
use rustc_span::{Symbol, sym};
88
use smallvec::SmallVec;
99

1010
use super::StableHashingContext;
@@ -54,56 +54,6 @@ fn is_ignored_attr(name: Symbol) -> bool {
5454
IGNORED_ATTRIBUTES.contains(&name)
5555
}
5656

57-
impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
58-
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
59-
let SourceFile {
60-
name: _, // We hash the smaller stable_id instead of this
61-
stable_id,
62-
cnum,
63-
// Do not hash the source as it is not encoded
64-
src: _,
65-
ref src_hash,
66-
// Already includes src_hash, this is redundant
67-
checksum_hash: _,
68-
external_src: _,
69-
start_pos: _,
70-
normalized_source_len: _,
71-
unnormalized_source_len: _,
72-
lines: _,
73-
ref multibyte_chars,
74-
ref normalized_pos,
75-
} = *self;
76-
77-
stable_id.hash_stable(hcx, hasher);
78-
79-
src_hash.hash_stable(hcx, hasher);
80-
81-
{
82-
// We are always in `Lines` form by the time we reach here.
83-
assert!(self.lines.read().is_lines());
84-
let lines = self.lines();
85-
// We only hash the relative position within this source_file
86-
lines.len().hash_stable(hcx, hasher);
87-
for &line in lines.iter() {
88-
line.hash_stable(hcx, hasher);
89-
}
90-
}
91-
92-
// We only hash the relative position within this source_file
93-
multibyte_chars.len().hash_stable(hcx, hasher);
94-
for &char_pos in multibyte_chars.iter() {
95-
char_pos.hash_stable(hcx, hasher);
96-
}
97-
98-
normalized_pos.len().hash_stable(hcx, hasher);
99-
for &char_pos in normalized_pos.iter() {
100-
char_pos.hash_stable(hcx, hasher);
101-
}
102-
103-
cnum.hash_stable(hcx, hasher);
104-
}
105-
}
106-
10757
impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features {
10858
fn hash_stable(&self, hcx: &mut StableHashingContext<'tcx>, hasher: &mut StableHasher) {
10959
// Unfortunately we cannot exhaustively list fields here, since the

0 commit comments

Comments
 (0)