@@ -20,7 +20,7 @@ use syntax::ast;
2020use syntax:: ext:: hygiene:: Mark ;
2121use syntax:: symbol:: { Symbol , InternedString } ;
2222use syntax_pos:: { Span , DUMMY_SP } ;
23- use util:: nodemap:: { HirIdMap , NodeMap } ;
23+ use util:: nodemap:: NodeMap ;
2424
2525/// The DefPathTable maps DefIndexes to DefKeys and vice versa.
2626/// Internally the DefPathTable holds a tree of DefKeys, where each DefKey
@@ -147,7 +147,6 @@ impl Decodable for DefPathTable {
147147pub struct Definitions {
148148 table : DefPathTable ,
149149 node_to_def_index : NodeMap < DefIndex > ,
150- hir_to_def_index : HirIdMap < DefIndex > ,
151150 def_index_to_node : [ Vec < ast:: NodeId > ; 2 ] ,
152151 pub ( super ) node_to_hir_id : IndexVec < ast:: NodeId , hir:: HirId > ,
153152 /// If `Mark` is an ID of some macro expansion,
@@ -442,34 +441,16 @@ impl Definitions {
442441 self . node_to_def_index . get ( & node) . cloned ( )
443442 }
444443
445- // FIXME(@ljedrz): replace the NodeId variant
446- #[ inline]
447- pub fn opt_def_index_from_hir_id ( & self , hir : hir:: HirId ) -> Option < DefIndex > {
448- self . hir_to_def_index . get ( & hir) . cloned ( )
449- }
450-
451444 #[ inline]
452445 pub fn opt_local_def_id ( & self , node : ast:: NodeId ) -> Option < DefId > {
453446 self . opt_def_index ( node) . map ( DefId :: local)
454447 }
455448
456- // FIXME(@ljedrz): replace the NodeId variant
457- #[ inline]
458- pub fn opt_local_def_id_from_hir_id ( & self , hir : hir:: HirId ) -> Option < DefId > {
459- self . opt_def_index_from_hir_id ( hir) . map ( DefId :: local)
460- }
461-
462449 #[ inline]
463450 pub fn local_def_id ( & self , node : ast:: NodeId ) -> DefId {
464451 self . opt_local_def_id ( node) . unwrap ( )
465452 }
466453
467- // FIXME(@ljedrz): replace the NodeId variant
468- #[ inline]
469- pub fn local_def_id_from_hir_id ( & self , hir : hir:: HirId ) -> DefId {
470- self . opt_local_def_id_from_hir_id ( hir) . unwrap ( )
471- }
472-
473454 #[ inline]
474455 pub fn as_local_node_id ( & self , def_id : DefId ) -> Option < ast:: NodeId > {
475456 if def_id. krate == LOCAL_CRATE {
@@ -549,7 +530,6 @@ impl Definitions {
549530 assert ! ( self . def_index_to_node[ address_space. index( ) ] . is_empty( ) ) ;
550531 self . def_index_to_node [ address_space. index ( ) ] . push ( ast:: CRATE_NODE_ID ) ;
551532 self . node_to_def_index . insert ( ast:: CRATE_NODE_ID , root_index) ;
552- self . hir_to_def_index . insert ( hir:: CRATE_HIR_ID , root_index) ;
553533
554534 // Allocate some other DefIndices that always must exist.
555535 GlobalMetaDataKind :: allocate_def_indices ( self ) ;
@@ -610,9 +590,6 @@ impl Definitions {
610590 if node_id != ast:: DUMMY_NODE_ID {
611591 debug ! ( "create_def_with_parent: def_index_to_node[{:?} <-> {:?}" , index, node_id) ;
612592 self . node_to_def_index . insert ( node_id, index) ;
613- if let Some ( hir_id) = self . node_to_hir_id . get ( node_id) {
614- self . hir_to_def_index . insert ( * hir_id, index) ;
615- }
616593 }
617594
618595 if expansion != Mark :: root ( ) {
0 commit comments