@@ -107,8 +107,6 @@ pub struct Definitions {
107
107
/// Their `HirId`s are defined by their position while lowering the enclosing owner.
108
108
// FIXME(cjgillot) Some `LocalDefId`s from `use` items are dropped during lowering and lack a `HirId`.
109
109
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 > ,
112
110
113
111
/// Item with a given `LocalDefId` was defined during macro expansion with ID `ExpnId`.
114
112
expansions_that_defined : FxHashMap < LocalDefId , ExpnId > ,
@@ -330,11 +328,6 @@ impl Definitions {
330
328
self . def_id_to_hir_id [ id] . unwrap ( )
331
329
}
332
330
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
-
338
331
/// Adds a root definition (no parent) and a few other reserved definitions.
339
332
pub fn new ( stable_crate_id : StableCrateId , crate_span : Span ) -> Definitions {
340
333
let key = DefKey {
@@ -362,7 +355,6 @@ impl Definitions {
362
355
Definitions {
363
356
table,
364
357
def_id_to_hir_id : Default :: default ( ) ,
365
- hir_id_to_def_id : Default :: default ( ) ,
366
358
expansions_that_defined : Default :: default ( ) ,
367
359
def_id_to_span,
368
360
stable_crate_id,
@@ -425,12 +417,6 @@ impl Definitions {
425
417
"trying to initialize `LocalDefId` <-> `HirId` mappings twice"
426
418
) ;
427
419
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
-
434
420
self . def_id_to_hir_id = mapping;
435
421
}
436
422
0 commit comments