@@ -20,7 +20,7 @@ use syntax::ast;
20
20
use syntax:: ext:: hygiene:: Mark ;
21
21
use syntax:: symbol:: { Symbol , InternedString } ;
22
22
use syntax_pos:: { Span , DUMMY_SP } ;
23
- use util:: nodemap:: { HirIdMap , NodeMap } ;
23
+ use util:: nodemap:: NodeMap ;
24
24
25
25
/// The DefPathTable maps DefIndexes to DefKeys and vice versa.
26
26
/// Internally the DefPathTable holds a tree of DefKeys, where each DefKey
@@ -147,7 +147,6 @@ impl Decodable for DefPathTable {
147
147
pub struct Definitions {
148
148
table : DefPathTable ,
149
149
node_to_def_index : NodeMap < DefIndex > ,
150
- hir_to_def_index : HirIdMap < DefIndex > ,
151
150
def_index_to_node : [ Vec < ast:: NodeId > ; 2 ] ,
152
151
pub ( super ) node_to_hir_id : IndexVec < ast:: NodeId , hir:: HirId > ,
153
152
/// If `Mark` is an ID of some macro expansion,
@@ -442,34 +441,16 @@ impl Definitions {
442
441
self . node_to_def_index . get ( & node) . cloned ( )
443
442
}
444
443
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
-
451
444
#[ inline]
452
445
pub fn opt_local_def_id ( & self , node : ast:: NodeId ) -> Option < DefId > {
453
446
self . opt_def_index ( node) . map ( DefId :: local)
454
447
}
455
448
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
-
462
449
#[ inline]
463
450
pub fn local_def_id ( & self , node : ast:: NodeId ) -> DefId {
464
451
self . opt_local_def_id ( node) . unwrap ( )
465
452
}
466
453
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
-
473
454
#[ inline]
474
455
pub fn as_local_node_id ( & self , def_id : DefId ) -> Option < ast:: NodeId > {
475
456
if def_id. krate == LOCAL_CRATE {
@@ -549,7 +530,6 @@ impl Definitions {
549
530
assert ! ( self . def_index_to_node[ address_space. index( ) ] . is_empty( ) ) ;
550
531
self . def_index_to_node [ address_space. index ( ) ] . push ( ast:: CRATE_NODE_ID ) ;
551
532
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) ;
553
533
554
534
// Allocate some other DefIndices that always must exist.
555
535
GlobalMetaDataKind :: allocate_def_indices ( self ) ;
@@ -610,9 +590,6 @@ impl Definitions {
610
590
if node_id != ast:: DUMMY_NODE_ID {
611
591
debug ! ( "create_def_with_parent: def_index_to_node[{:?} <-> {:?}" , index, node_id) ;
612
592
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
- }
616
593
}
617
594
618
595
if expansion != Mark :: root ( ) {
0 commit comments