@@ -10,7 +10,6 @@ use crate::ich::Fingerprint;
10
10
use rustc_data_structures:: fx:: FxHashMap ;
11
11
use rustc_data_structures:: indexed_vec:: { IndexVec } ;
12
12
use rustc_data_structures:: stable_hasher:: StableHasher ;
13
- use serialize:: { Encodable , Decodable , Encoder , Decoder } ;
14
13
use crate :: session:: CrateDisambiguator ;
15
14
use std:: borrow:: Borrow ;
16
15
use std:: fmt:: Write ;
@@ -25,14 +24,13 @@ use crate::util::nodemap::NodeMap;
25
24
/// Internally the DefPathTable holds a tree of DefKeys, where each DefKey
26
25
/// stores the DefIndex of its parent.
27
26
/// There is one DefPathTable for each crate.
28
- #[ derive( Clone , Default ) ]
27
+ #[ derive( Clone , Default , RustcDecodable , RustcEncodable ) ]
29
28
pub struct DefPathTable {
30
29
index_to_key : Vec < DefKey > ,
31
30
def_path_hashes : Vec < DefPathHash > ,
32
31
}
33
32
34
33
impl DefPathTable {
35
-
36
34
fn allocate ( & mut self ,
37
35
key : DefKey ,
38
36
def_path_hash : DefPathHash )
@@ -86,28 +84,6 @@ impl DefPathTable {
86
84
}
87
85
}
88
86
89
-
90
- impl Encodable for DefPathTable {
91
- fn encode < S : Encoder > ( & self , s : & mut S ) -> Result < ( ) , S :: Error > {
92
- // Index to key
93
- self . index_to_key . encode ( s) ?;
94
-
95
- // DefPath hashes
96
- self . def_path_hashes . encode ( s) ?;
97
-
98
- Ok ( ( ) )
99
- }
100
- }
101
-
102
- impl Decodable for DefPathTable {
103
- fn decode < D : Decoder > ( d : & mut D ) -> Result < DefPathTable , D :: Error > {
104
- Ok ( DefPathTable {
105
- index_to_key : Decodable :: decode ( d) ?,
106
- def_path_hashes : Decodable :: decode ( d) ?,
107
- } )
108
- }
109
- }
110
-
111
87
/// The definition table containing node definitions.
112
88
/// It holds the `DefPathTable` for local `DefId`s/`DefPath`s and it also stores a
113
89
/// mapping from `NodeId`s to local `DefId`s.
0 commit comments