@@ -10,7 +10,6 @@ use crate::ich::Fingerprint;
1010use rustc_data_structures:: fx:: FxHashMap ;
1111use rustc_data_structures:: indexed_vec:: { IndexVec } ;
1212use rustc_data_structures:: stable_hasher:: StableHasher ;
13- use serialize:: { Encodable , Decodable , Encoder , Decoder } ;
1413use crate :: session:: CrateDisambiguator ;
1514use std:: borrow:: Borrow ;
1615use std:: fmt:: Write ;
@@ -25,14 +24,13 @@ use crate::util::nodemap::NodeMap;
2524/// Internally the DefPathTable holds a tree of DefKeys, where each DefKey
2625/// stores the DefIndex of its parent.
2726/// There is one DefPathTable for each crate.
28- #[ derive( Clone , Default ) ]
27+ #[ derive( Clone , Default , RustcDecodable , RustcEncodable ) ]
2928pub struct DefPathTable {
3029 index_to_key : Vec < DefKey > ,
3130 def_path_hashes : Vec < DefPathHash > ,
3231}
3332
3433impl DefPathTable {
35-
3634 fn allocate ( & mut self ,
3735 key : DefKey ,
3836 def_path_hash : DefPathHash )
@@ -86,28 +84,6 @@ impl DefPathTable {
8684 }
8785}
8886
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-
11187/// The definition table containing node definitions.
11288/// It holds the `DefPathTable` for local `DefId`s/`DefPath`s and it also stores a
11389/// mapping from `NodeId`s to local `DefId`s.
0 commit comments