@@ -27,7 +27,7 @@ use session::{CrateDisambiguator, Session};
2727use std:: mem;
2828use syntax:: ast:: NodeId ;
2929use syntax:: codemap:: { SourceMap , StableFilemapId } ;
30- use syntax_pos:: { BytePos , Span , DUMMY_SP , FileMap } ;
30+ use syntax_pos:: { BytePos , Span , DUMMY_SP , SourceFile } ;
3131use syntax_pos:: hygiene:: { Mark , SyntaxContext , ExpnInfo } ;
3232use ty;
3333use ty:: codec:: { self as ty_codec, TyDecoder , TyEncoder } ;
@@ -63,10 +63,10 @@ pub struct OnDiskCache<'sess> {
6363 cnum_map : Once < IndexVec < CrateNum , Option < CrateNum > > > ,
6464
6565 codemap : & ' sess SourceMap ,
66- file_index_to_stable_id : FxHashMap < FileMapIndex , StableFilemapId > ,
66+ file_index_to_stable_id : FxHashMap < SourceFileIndex , StableFilemapId > ,
6767
6868 // These two fields caches that are populated lazily during decoding.
69- file_index_to_file : Lock < FxHashMap < FileMapIndex , Lrc < FileMap > > > ,
69+ file_index_to_file : Lock < FxHashMap < SourceFileIndex , Lrc < SourceFile > > > ,
7070 synthetic_expansion_infos : Lock < FxHashMap < AbsoluteBytePos , SyntaxContext > > ,
7171
7272 // A map from dep-node to the position of the cached query result in
@@ -83,7 +83,7 @@ pub struct OnDiskCache<'sess> {
8383// This type is used only for (de-)serialization.
8484#[ derive( RustcEncodable , RustcDecodable ) ]
8585struct Footer {
86- file_index_to_stable_id : FxHashMap < FileMapIndex , StableFilemapId > ,
86+ file_index_to_stable_id : FxHashMap < SourceFileIndex , StableFilemapId > ,
8787 prev_cnums : Vec < ( u32 , String , CrateDisambiguator ) > ,
8888 query_result_index : EncodedQueryResultIndex ,
8989 diagnostics_index : EncodedQueryResultIndex ,
@@ -96,7 +96,7 @@ type EncodedDiagnosticsIndex = Vec<(SerializedDepNodeIndex, AbsoluteBytePos)>;
9696type EncodedDiagnostics = Vec < Diagnostic > ;
9797
9898#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
99- struct FileMapIndex ( u32 ) ;
99+ struct SourceFileIndex ( u32 ) ;
100100
101101#[ derive( Copy , Clone , Debug , Hash , Eq , PartialEq , RustcEncodable , RustcDecodable ) ]
102102struct AbsoluteBytePos ( u32 ) ;
@@ -173,14 +173,14 @@ impl<'sess> OnDiskCache<'sess> {
173173 {
174174 // Serializing the DepGraph should not modify it:
175175 tcx. dep_graph . with_ignore ( || {
176- // Allocate FileMapIndices
176+ // Allocate SourceFileIndices
177177 let ( file_to_file_index, file_index_to_stable_id) = {
178178 let mut file_to_file_index = FxHashMap ( ) ;
179179 let mut file_index_to_stable_id = FxHashMap ( ) ;
180180
181181 for ( index, file) in tcx. sess . codemap ( ) . files ( ) . iter ( ) . enumerate ( ) {
182- let index = FileMapIndex ( index as u32 ) ;
183- let file_ptr: * const FileMap = & * * file as * const _ ;
182+ let index = SourceFileIndex ( index as u32 ) ;
183+ let file_ptr: * const SourceFile = & * * file as * const _ ;
184184 file_to_file_index. insert ( file_ptr, index) ;
185185 file_index_to_stable_id. insert ( index, StableFilemapId :: new ( & file) ) ;
186186 }
@@ -478,13 +478,13 @@ struct CacheDecoder<'a, 'tcx: 'a, 'x> {
478478 codemap : & ' x SourceMap ,
479479 cnum_map : & ' x IndexVec < CrateNum , Option < CrateNum > > ,
480480 synthetic_expansion_infos : & ' x Lock < FxHashMap < AbsoluteBytePos , SyntaxContext > > ,
481- file_index_to_file : & ' x Lock < FxHashMap < FileMapIndex , Lrc < FileMap > > > ,
482- file_index_to_stable_id : & ' x FxHashMap < FileMapIndex , StableFilemapId > ,
481+ file_index_to_file : & ' x Lock < FxHashMap < SourceFileIndex , Lrc < SourceFile > > > ,
482+ file_index_to_stable_id : & ' x FxHashMap < SourceFileIndex , StableFilemapId > ,
483483 alloc_decoding_session : AllocDecodingSession < ' x > ,
484484}
485485
486486impl < ' a , ' tcx , ' x > CacheDecoder < ' a , ' tcx , ' x > {
487- fn file_index_to_file ( & self , index : FileMapIndex ) -> Lrc < FileMap > {
487+ fn file_index_to_file ( & self , index : SourceFileIndex ) -> Lrc < SourceFile > {
488488 let CacheDecoder {
489489 ref file_index_to_file,
490490 ref file_index_to_stable_id,
@@ -495,7 +495,7 @@ impl<'a, 'tcx, 'x> CacheDecoder<'a, 'tcx, 'x> {
495495 file_index_to_file. borrow_mut ( ) . entry ( index) . or_insert_with ( || {
496496 let stable_id = file_index_to_stable_id[ & index] ;
497497 codemap. filemap_by_stable_id ( stable_id)
498- . expect ( "Failed to lookup FileMap in new context." )
498+ . expect ( "Failed to lookup SourceFile in new context." )
499499 } ) . clone ( )
500500 }
501501}
@@ -617,7 +617,7 @@ impl<'a, 'tcx, 'x> SpecializedDecoder<Span> for CacheDecoder<'a, 'tcx, 'x> {
617617 debug_assert_eq ! ( tag, TAG_VALID_SPAN ) ;
618618 }
619619
620- let file_lo_index = FileMapIndex :: decode ( self ) ?;
620+ let file_lo_index = SourceFileIndex :: decode ( self ) ?;
621621 let line_lo = usize:: decode ( self ) ?;
622622 let col_lo = BytePos :: decode ( self ) ?;
623623 let len = BytePos :: decode ( self ) ?;
@@ -771,14 +771,14 @@ struct CacheEncoder<'enc, 'a, 'tcx, E>
771771 interpret_allocs : FxHashMap < interpret:: AllocId , usize > ,
772772 interpret_allocs_inverse : Vec < interpret:: AllocId > ,
773773 codemap : CachingCodemapView < ' tcx > ,
774- file_to_file_index : FxHashMap < * const FileMap , FileMapIndex > ,
774+ file_to_file_index : FxHashMap < * const SourceFile , SourceFileIndex > ,
775775}
776776
777777impl < ' enc , ' a , ' tcx , E > CacheEncoder < ' enc , ' a , ' tcx , E >
778778 where E : ' enc + ty_codec:: TyEncoder
779779{
780- fn filemap_index ( & mut self , filemap : Lrc < FileMap > ) -> FileMapIndex {
781- self . file_to_file_index [ & ( & * filemap as * const FileMap ) ]
780+ fn filemap_index ( & mut self , filemap : Lrc < SourceFile > ) -> SourceFileIndex {
781+ self . file_to_file_index [ & ( & * filemap as * const SourceFile ) ]
782782 }
783783
784784 /// Encode something with additional information that allows to do some
0 commit comments