@@ -678,8 +678,6 @@ pub struct FileMap {
678
678
pub src : Option < Rc < String > > ,
679
679
/// The source code's hash
680
680
pub src_hash : u128 ,
681
- /// The stable id used during incr. comp.
682
- pub stable_id : StableFilemapId ,
683
681
/// The external source code (used for external crates, which will have a `None`
684
682
/// value as `self.src`.
685
683
pub external_src : RefCell < ExternalSource > ,
@@ -695,34 +693,12 @@ pub struct FileMap {
695
693
pub non_narrow_chars : RefCell < Vec < NonNarrowChar > > ,
696
694
}
697
695
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
-
719
696
impl Encodable for FileMap {
720
697
fn encode < S : Encoder > ( & self , s : & mut S ) -> Result < ( ) , S :: Error > {
721
698
s. emit_struct ( "FileMap" , 8 , |s| {
722
699
s. emit_struct_field ( "name" , 0 , |s| self . name . encode ( s) ) ?;
723
700
s. emit_struct_field ( "name_was_remapped" , 1 , |s| self . name_was_remapped . encode ( s) ) ?;
724
701
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) ) ?;
726
702
s. emit_struct_field ( "start_pos" , 4 , |s| self . start_pos . encode ( s) ) ?;
727
703
s. emit_struct_field ( "end_pos" , 5 , |s| self . end_pos . encode ( s) ) ?;
728
704
s. emit_struct_field ( "lines" , 6 , |s| {
@@ -790,8 +766,6 @@ impl Decodable for FileMap {
790
766
d. read_struct_field ( "name_was_remapped" , 1 , |d| Decodable :: decode ( d) ) ?;
791
767
let src_hash: u128 =
792
768
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) ) ?;
795
769
let start_pos: BytePos =
796
770
d. read_struct_field ( "start_pos" , 4 , |d| Decodable :: decode ( d) ) ?;
797
771
let end_pos: BytePos = d. read_struct_field ( "end_pos" , 5 , |d| Decodable :: decode ( d) ) ?;
@@ -839,7 +813,6 @@ impl Decodable for FileMap {
839
813
end_pos,
840
814
src : None ,
841
815
src_hash,
842
- stable_id,
843
816
external_src : RefCell :: new ( ExternalSource :: AbsentOk ) ,
844
817
lines : RefCell :: new ( lines) ,
845
818
multibyte_chars : RefCell :: new ( multibyte_chars) ,
@@ -866,11 +839,6 @@ impl FileMap {
866
839
let mut hasher: StableHasher < u128 > = StableHasher :: new ( ) ;
867
840
hasher. write ( src. as_bytes ( ) ) ;
868
841
let src_hash = hasher. finish ( ) ;
869
-
870
- let stable_id = StableFilemapId :: new ( & name,
871
- name_was_remapped,
872
- & unmapped_path) ;
873
-
874
842
let end_pos = start_pos. to_usize ( ) + src. len ( ) ;
875
843
876
844
FileMap {
@@ -880,7 +848,6 @@ impl FileMap {
880
848
crate_of_origin : 0 ,
881
849
src : Some ( Rc :: new ( src) ) ,
882
850
src_hash,
883
- stable_id,
884
851
external_src : RefCell :: new ( ExternalSource :: Unneeded ) ,
885
852
start_pos,
886
853
end_pos : Pos :: from_usize ( end_pos) ,
0 commit comments