|
4 | 4 | use rustc_ast as ast; |
5 | 5 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
6 | 6 | use rustc_hir as hir; |
7 | | -use rustc_span::{SourceFile, Symbol, sym}; |
| 7 | +use rustc_span::{Symbol, sym}; |
8 | 8 | use smallvec::SmallVec; |
9 | 9 |
|
10 | 10 | use super::StableHashingContext; |
@@ -54,56 +54,6 @@ fn is_ignored_attr(name: Symbol) -> bool { |
54 | 54 | IGNORED_ATTRIBUTES.contains(&name) |
55 | 55 | } |
56 | 56 |
|
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 | | - |
107 | 57 | impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features { |
108 | 58 | fn hash_stable(&self, hcx: &mut StableHashingContext<'tcx>, hasher: &mut StableHasher) { |
109 | 59 | // Unfortunately we cannot exhaustively list fields here, since the |
|
0 commit comments