@@ -107,8 +107,6 @@ pub struct Definitions {
107107 /// Their `HirId`s are defined by their position while lowering the enclosing owner.
108108 // FIXME(cjgillot) Some `LocalDefId`s from `use` items are dropped during lowering and lack a `HirId`.
109109 pub ( super ) def_id_to_hir_id : IndexVec < LocalDefId , Option < hir:: HirId > > ,
110- /// The reverse mapping of `def_id_to_hir_id`.
111- pub ( super ) hir_id_to_def_id : FxHashMap < hir:: HirId , LocalDefId > ,
112110
113111 /// Item with a given `LocalDefId` was defined during macro expansion with ID `ExpnId`.
114112 expansions_that_defined : FxHashMap < LocalDefId , ExpnId > ,
@@ -330,11 +328,6 @@ impl Definitions {
330328 self . def_id_to_hir_id [ id] . unwrap ( )
331329 }
332330
333- #[ inline]
334- pub fn opt_hir_id_to_local_def_id ( & self , hir_id : hir:: HirId ) -> Option < LocalDefId > {
335- self . hir_id_to_def_id . get ( & hir_id) . copied ( )
336- }
337-
338331 /// Adds a root definition (no parent) and a few other reserved definitions.
339332 pub fn new ( stable_crate_id : StableCrateId , crate_span : Span ) -> Definitions {
340333 let key = DefKey {
@@ -362,7 +355,6 @@ impl Definitions {
362355 Definitions {
363356 table,
364357 def_id_to_hir_id : Default :: default ( ) ,
365- hir_id_to_def_id : Default :: default ( ) ,
366358 expansions_that_defined : Default :: default ( ) ,
367359 def_id_to_span,
368360 stable_crate_id,
@@ -425,12 +417,6 @@ impl Definitions {
425417 "trying to initialize `LocalDefId` <-> `HirId` mappings twice"
426418 ) ;
427419
428- // Build the reverse mapping of `def_id_to_hir_id`.
429- self . hir_id_to_def_id = mapping
430- . iter_enumerated ( )
431- . filter_map ( |( def_id, hir_id) | hir_id. map ( |hir_id| ( hir_id, def_id) ) )
432- . collect ( ) ;
433-
434420 self . def_id_to_hir_id = mapping;
435421 }
436422
0 commit comments