@@ -62,7 +62,7 @@ pub struct OnDiskCache<'sess> {
62
62
prev_cnums : Vec < ( u32 , String , CrateDisambiguator ) > ,
63
63
cnum_map : Once < IndexVec < CrateNum , Option < CrateNum > > > ,
64
64
65
- codemap : & ' sess SourceMap ,
65
+ source_map : & ' sess SourceMap ,
66
66
file_index_to_stable_id : FxHashMap < SourceFileIndex , StableFilemapId > ,
67
67
68
68
// These two fields caches that are populated lazily during decoding.
@@ -140,7 +140,7 @@ impl<'sess> OnDiskCache<'sess> {
140
140
file_index_to_file : Lock :: new ( FxHashMap ( ) ) ,
141
141
prev_cnums : footer. prev_cnums ,
142
142
cnum_map : Once :: new ( ) ,
143
- codemap : sess. source_map ( ) ,
143
+ source_map : sess. source_map ( ) ,
144
144
current_diagnostics : Lock :: new ( FxHashMap ( ) ) ,
145
145
query_result_index : footer. query_result_index . into_iter ( ) . collect ( ) ,
146
146
prev_diagnostics_index : footer. diagnostics_index . into_iter ( ) . collect ( ) ,
@@ -149,14 +149,14 @@ impl<'sess> OnDiskCache<'sess> {
149
149
}
150
150
}
151
151
152
- pub fn new_empty ( codemap : & ' sess SourceMap ) -> OnDiskCache < ' sess > {
152
+ pub fn new_empty ( source_map : & ' sess SourceMap ) -> OnDiskCache < ' sess > {
153
153
OnDiskCache {
154
154
serialized_data : Vec :: new ( ) ,
155
155
file_index_to_stable_id : FxHashMap ( ) ,
156
156
file_index_to_file : Lock :: new ( FxHashMap ( ) ) ,
157
157
prev_cnums : vec ! [ ] ,
158
158
cnum_map : Once :: new ( ) ,
159
- codemap ,
159
+ source_map ,
160
160
current_diagnostics : Lock :: new ( FxHashMap ( ) ) ,
161
161
query_result_index : FxHashMap ( ) ,
162
162
prev_diagnostics_index : FxHashMap ( ) ,
@@ -196,7 +196,7 @@ impl<'sess> OnDiskCache<'sess> {
196
196
expn_info_shorthands : FxHashMap ( ) ,
197
197
interpret_allocs : FxHashMap ( ) ,
198
198
interpret_allocs_inverse : Vec :: new ( ) ,
199
- codemap : CachingCodemapView :: new ( tcx. sess . source_map ( ) ) ,
199
+ source_map : CachingCodemapView :: new ( tcx. sess . source_map ( ) ) ,
200
200
file_to_file_index,
201
201
} ;
202
202
@@ -413,7 +413,7 @@ impl<'sess> OnDiskCache<'sess> {
413
413
let mut decoder = CacheDecoder {
414
414
tcx,
415
415
opaque : opaque:: Decoder :: new ( & self . serialized_data [ ..] , pos. to_usize ( ) ) ,
416
- codemap : self . codemap ,
416
+ source_map : self . source_map ,
417
417
cnum_map : self . cnum_map . get ( ) ,
418
418
file_index_to_file : & self . file_index_to_file ,
419
419
file_index_to_stable_id : & self . file_index_to_stable_id ,
@@ -475,7 +475,7 @@ impl<'sess> OnDiskCache<'sess> {
475
475
struct CacheDecoder < ' a , ' tcx : ' a , ' x > {
476
476
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
477
477
opaque : opaque:: Decoder < ' x > ,
478
- codemap : & ' x SourceMap ,
478
+ source_map : & ' x SourceMap ,
479
479
cnum_map : & ' x IndexVec < CrateNum , Option < CrateNum > > ,
480
480
synthetic_expansion_infos : & ' x Lock < FxHashMap < AbsoluteBytePos , SyntaxContext > > ,
481
481
file_index_to_file : & ' x Lock < FxHashMap < SourceFileIndex , Lrc < SourceFile > > > ,
@@ -488,13 +488,13 @@ impl<'a, 'tcx, 'x> CacheDecoder<'a, 'tcx, 'x> {
488
488
let CacheDecoder {
489
489
ref file_index_to_file,
490
490
ref file_index_to_stable_id,
491
- ref codemap ,
491
+ ref source_map ,
492
492
..
493
493
} = * self ;
494
494
495
495
file_index_to_file. borrow_mut ( ) . entry ( index) . or_insert_with ( || {
496
496
let stable_id = file_index_to_stable_id[ & index] ;
497
- codemap . source_file_by_stable_id ( stable_id)
497
+ source_map . source_file_by_stable_id ( stable_id)
498
498
. expect ( "Failed to lookup SourceFile in new context." )
499
499
} ) . clone ( )
500
500
}
@@ -770,7 +770,7 @@ struct CacheEncoder<'enc, 'a, 'tcx, E>
770
770
expn_info_shorthands : FxHashMap < Mark , AbsoluteBytePos > ,
771
771
interpret_allocs : FxHashMap < interpret:: AllocId , usize > ,
772
772
interpret_allocs_inverse : Vec < interpret:: AllocId > ,
773
- codemap : CachingCodemapView < ' tcx > ,
773
+ source_map : CachingCodemapView < ' tcx > ,
774
774
file_to_file_index : FxHashMap < * const SourceFile , SourceFileIndex > ,
775
775
}
776
776
@@ -836,7 +836,7 @@ impl<'enc, 'a, 'tcx, E> SpecializedEncoder<Span> for CacheEncoder<'enc, 'a, 'tcx
836
836
return TAG_INVALID_SPAN . encode ( self ) ;
837
837
}
838
838
839
- let ( file_lo, line_lo, col_lo) = match self . codemap
839
+ let ( file_lo, line_lo, col_lo) = match self . source_map
840
840
. byte_pos_to_line_and_col ( span_data. lo ) {
841
841
Some ( pos) => pos,
842
842
None => {
0 commit comments