@@ -36,6 +36,7 @@ use util::nodemap::NodeMap;
3636/// Internally the DefPathTable holds a tree of DefKeys, where each DefKey
3737/// stores the DefIndex of its parent.
3838/// There is one DefPathTable for each crate.
39+ #[ derive( Default ) ]
3940pub struct DefPathTable {
4041 index_to_key : [ Vec < DefKey > ; 2 ] ,
4142 def_path_hashes : [ Vec < DefPathHash > ; 2 ] ,
@@ -153,7 +154,7 @@ impl Decodable for DefPathTable {
153154/// The definition table containing node definitions.
154155/// It holds the DefPathTable for local DefIds/DefPaths and it also stores a
155156/// mapping from NodeIds to local DefIds.
156- #[ derive( Clone ) ]
157+ #[ derive( Clone , Default ) ]
157158pub struct Definitions {
158159 table : DefPathTable ,
159160 node_to_def_index : NodeMap < DefIndex > ,
@@ -412,20 +413,8 @@ impl Definitions {
412413 /// ascending order.
413414 ///
414415 /// FIXME: there is probably a better place to put this comment.
415- pub fn new ( ) -> Definitions {
416- Definitions {
417- table : DefPathTable {
418- index_to_key : [ vec ! [ ] , vec ! [ ] ] ,
419- def_path_hashes : [ vec ! [ ] , vec ! [ ] ] ,
420- } ,
421- node_to_def_index : Default :: default ( ) ,
422- def_index_to_node : [ vec ! [ ] , vec ! [ ] ] ,
423- node_to_hir_id : IndexVec :: new ( ) ,
424- parent_modules_of_macro_defs : Default :: default ( ) ,
425- expansions_that_defined : Default :: default ( ) ,
426- next_disambiguator : Default :: default ( ) ,
427- def_index_to_span : Default :: default ( ) ,
428- }
416+ pub fn new ( ) -> Self {
417+ Self :: default ( )
429418 }
430419
431420 pub fn def_path_table ( & self ) -> & DefPathTable {
0 commit comments