@@ -12,7 +12,7 @@ use hir;
12
12
use hir:: def_id:: { DefId , DefIndex } ;
13
13
use hir:: map:: DefPathHash ;
14
14
use hir:: map:: definitions:: Definitions ;
15
- use ich:: { self , CachingCodemapView , Fingerprint } ;
15
+ use ich:: { self , CachingSourceMapView , Fingerprint } ;
16
16
use middle:: cstore:: CrateStore ;
17
17
use ty:: { TyCtxt , fast_reject} ;
18
18
use mir:: interpret:: AllocId ;
@@ -25,7 +25,7 @@ use std::cell::RefCell;
25
25
26
26
use syntax:: ast;
27
27
28
- use syntax:: codemap :: CodeMap ;
28
+ use syntax:: source_map :: SourceMap ;
29
29
use syntax:: ext:: hygiene:: SyntaxContext ;
30
30
use syntax:: symbol:: Symbol ;
31
31
use syntax_pos:: { Span , DUMMY_SP } ;
@@ -57,9 +57,9 @@ pub struct StableHashingContext<'a> {
57
57
node_id_hashing_mode : NodeIdHashingMode ,
58
58
59
59
// Very often, we are hashing something that does not need the
60
- // CachingCodemapView , so we initialize it lazily.
61
- raw_codemap : & ' a CodeMap ,
62
- caching_codemap : Option < CachingCodemapView < ' a > > ,
60
+ // CachingSourceMapView , so we initialize it lazily.
61
+ raw_source_map : & ' a SourceMap ,
62
+ caching_source_map : Option < CachingSourceMapView < ' a > > ,
63
63
64
64
pub ( super ) alloc_id_recursion_tracker : FxHashSet < AllocId > ,
65
65
}
@@ -100,8 +100,8 @@ impl<'a> StableHashingContext<'a> {
100
100
body_resolver : BodyResolver ( krate) ,
101
101
definitions,
102
102
cstore,
103
- caching_codemap : None ,
104
- raw_codemap : sess. codemap ( ) ,
103
+ caching_source_map : None ,
104
+ raw_source_map : sess. source_map ( ) ,
105
105
hash_spans : hash_spans_initial,
106
106
hash_bodies : true ,
107
107
node_id_hashing_mode : NodeIdHashingMode :: HashDefPath ,
@@ -169,13 +169,13 @@ impl<'a> StableHashingContext<'a> {
169
169
}
170
170
171
171
#[ inline]
172
- pub fn codemap ( & mut self ) -> & mut CachingCodemapView < ' a > {
173
- match self . caching_codemap {
172
+ pub fn source_map ( & mut self ) -> & mut CachingSourceMapView < ' a > {
173
+ match self . caching_source_map {
174
174
Some ( ref mut cm) => {
175
175
cm
176
176
}
177
177
ref mut none => {
178
- * none = Some ( CachingCodemapView :: new ( self . raw_codemap ) ) ;
178
+ * none = Some ( CachingSourceMapView :: new ( self . raw_source_map ) ) ;
179
179
none. as_mut ( ) . unwrap ( )
180
180
}
181
181
}
@@ -308,9 +308,9 @@ impl<'a> HashStable<StableHashingContext<'a>> for Span {
308
308
309
309
// Hash a span in a stable way. We can't directly hash the span's BytePos
310
310
// fields (that would be similar to hashing pointers, since those are just
311
- // offsets into the CodeMap ). Instead, we hash the (file name, line, column)
312
- // triple, which stays the same even if the containing FileMap has moved
313
- // within the CodeMap .
311
+ // offsets into the SourceMap ). Instead, we hash the (file name, line, column)
312
+ // triple, which stays the same even if the containing SourceFile has moved
313
+ // within the SourceMap .
314
314
// Also note that we are hashing byte offsets for the column, not unicode
315
315
// codepoint offsets. For the purpose of the hash that's sufficient.
316
316
// Also, hashing filenames is expensive so we avoid doing it twice when the
@@ -340,7 +340,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for Span {
340
340
return std_hash:: Hash :: hash ( & TAG_INVALID_SPAN , hasher) ;
341
341
}
342
342
343
- let ( file_lo, line_lo, col_lo) = match hcx. codemap ( )
343
+ let ( file_lo, line_lo, col_lo) = match hcx. source_map ( )
344
344
. byte_pos_to_line_and_col ( span. lo ) {
345
345
Some ( pos) => pos,
346
346
None => {
0 commit comments