@@ -678,8 +678,6 @@ pub struct FileMap {
678678 pub src : Option < Rc < String > > ,
679679 /// The source code's hash
680680 pub src_hash : u128 ,
681- /// The stable id used during incr. comp.
682- pub stable_id : StableFilemapId ,
683681 /// The external source code (used for external crates, which will have a `None`
684682 /// value as `self.src`.
685683 pub external_src : RefCell < ExternalSource > ,
@@ -695,34 +693,12 @@ pub struct FileMap {
695693 pub non_narrow_chars : RefCell < Vec < NonNarrowChar > > ,
696694}
697695
698- // This is a FileMap identifier that is used to correlate FileMaps between
699- // subsequent compilation sessions (which is something we need to do during
700- // incremental compilation).
701- #[ derive( Copy , Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable , Debug ) ]
702- pub struct StableFilemapId ( pub u128 ) ;
703-
704- impl StableFilemapId {
705- pub fn new ( name : & FileName ,
706- name_was_remapped : bool ,
707- unmapped_path : & FileName )
708- -> StableFilemapId {
709- use std:: hash:: Hash ;
710-
711- let mut hasher = StableHasher :: new ( ) ;
712- name. hash ( & mut hasher) ;
713- name_was_remapped. hash ( & mut hasher) ;
714- unmapped_path. hash ( & mut hasher) ;
715- StableFilemapId ( hasher. finish ( ) )
716- }
717- }
718-
719696impl Encodable for FileMap {
720697 fn encode < S : Encoder > ( & self , s : & mut S ) -> Result < ( ) , S :: Error > {
721698 s. emit_struct ( "FileMap" , 8 , |s| {
722699 s. emit_struct_field ( "name" , 0 , |s| self . name . encode ( s) ) ?;
723700 s. emit_struct_field ( "name_was_remapped" , 1 , |s| self . name_was_remapped . encode ( s) ) ?;
724701 s. emit_struct_field ( "src_hash" , 2 , |s| self . src_hash . encode ( s) ) ?;
725- s. emit_struct_field ( "stable_id" , 3 , |s| self . stable_id . encode ( s) ) ?;
726702 s. emit_struct_field ( "start_pos" , 4 , |s| self . start_pos . encode ( s) ) ?;
727703 s. emit_struct_field ( "end_pos" , 5 , |s| self . end_pos . encode ( s) ) ?;
728704 s. emit_struct_field ( "lines" , 6 , |s| {
@@ -790,8 +766,6 @@ impl Decodable for FileMap {
790766 d. read_struct_field ( "name_was_remapped" , 1 , |d| Decodable :: decode ( d) ) ?;
791767 let src_hash: u128 =
792768 d. read_struct_field ( "src_hash" , 2 , |d| Decodable :: decode ( d) ) ?;
793- let stable_id: StableFilemapId =
794- d. read_struct_field ( "stable_id" , 3 , |d| Decodable :: decode ( d) ) ?;
795769 let start_pos: BytePos =
796770 d. read_struct_field ( "start_pos" , 4 , |d| Decodable :: decode ( d) ) ?;
797771 let end_pos: BytePos = d. read_struct_field ( "end_pos" , 5 , |d| Decodable :: decode ( d) ) ?;
@@ -839,7 +813,6 @@ impl Decodable for FileMap {
839813 end_pos,
840814 src : None ,
841815 src_hash,
842- stable_id,
843816 external_src : RefCell :: new ( ExternalSource :: AbsentOk ) ,
844817 lines : RefCell :: new ( lines) ,
845818 multibyte_chars : RefCell :: new ( multibyte_chars) ,
@@ -866,11 +839,6 @@ impl FileMap {
866839 let mut hasher: StableHasher < u128 > = StableHasher :: new ( ) ;
867840 hasher. write ( src. as_bytes ( ) ) ;
868841 let src_hash = hasher. finish ( ) ;
869-
870- let stable_id = StableFilemapId :: new ( & name,
871- name_was_remapped,
872- & unmapped_path) ;
873-
874842 let end_pos = start_pos. to_usize ( ) + src. len ( ) ;
875843
876844 FileMap {
@@ -880,7 +848,6 @@ impl FileMap {
880848 crate_of_origin : 0 ,
881849 src : Some ( Rc :: new ( src) ) ,
882850 src_hash,
883- stable_id,
884851 external_src : RefCell :: new ( ExternalSource :: Unneeded ) ,
885852 start_pos,
886853 end_pos : Pos :: from_usize ( end_pos) ,
0 commit comments