File tree 4 files changed +4
-28
lines changed
4 files changed +4
-28
lines changed Original file line number Diff line number Diff line change @@ -1592,23 +1592,6 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1592
1592
self . def_path_hash_unlocked ( index, & mut def_path_hashes)
1593
1593
}
1594
1594
1595
- fn all_def_path_hashes_and_def_ids ( & self ) -> Vec < ( DefPathHash , DefId ) > {
1596
- let mut def_path_hashes = self . def_path_hash_cache . lock ( ) ;
1597
- let mut def_index_to_data = |index| {
1598
- ( self . def_path_hash_unlocked ( index, & mut def_path_hashes) , self . local_def_id ( index) )
1599
- } ;
1600
- if let Some ( data) = & self . root . proc_macro_data {
1601
- std:: iter:: once ( CRATE_DEF_INDEX )
1602
- . chain ( data. macros . decode ( self ) )
1603
- . map ( def_index_to_data)
1604
- . collect ( )
1605
- } else {
1606
- ( 0 ..self . num_def_ids ( ) )
1607
- . map ( |index| def_index_to_data ( DefIndex :: from_usize ( index) ) )
1608
- . collect ( )
1609
- }
1610
- }
1611
-
1612
1595
/// Get the `DepNodeIndex` corresponding this crate. The result of this
1613
1596
/// method is cached in the `dep_node_index` field.
1614
1597
fn get_crate_dep_node_index ( & self , tcx : TyCtxt < ' tcx > ) -> DepNodeIndex {
Original file line number Diff line number Diff line change @@ -456,6 +456,10 @@ impl CStore {
456
456
pub fn module_expansion_untracked ( & self , def_id : DefId , sess : & Session ) -> ExpnId {
457
457
self . get_crate_data ( def_id. krate ) . module_expansion ( def_id. index , sess)
458
458
}
459
+
460
+ pub fn num_def_ids ( & self , cnum : CrateNum ) -> usize {
461
+ self . get_crate_data ( cnum) . num_def_ids ( )
462
+ }
459
463
}
460
464
461
465
impl CrateStore for CStore {
@@ -498,14 +502,6 @@ impl CrateStore for CStore {
498
502
self . get_crate_data ( def. krate ) . def_path_hash ( def. index )
499
503
}
500
504
501
- fn all_def_path_hashes_and_def_ids ( & self , cnum : CrateNum ) -> Vec < ( DefPathHash , DefId ) > {
502
- self . get_crate_data ( cnum) . all_def_path_hashes_and_def_ids ( )
503
- }
504
-
505
- fn num_def_ids ( & self , cnum : CrateNum ) -> usize {
506
- self . get_crate_data ( cnum) . num_def_ids ( )
507
- }
508
-
509
505
// See `CrateMetadataRef::def_path_hash_to_def_id` for more details
510
506
fn def_path_hash_to_def_id (
511
507
& self ,
Original file line number Diff line number Diff line change @@ -189,8 +189,6 @@ pub trait CrateStore {
189
189
fn def_kind ( & self , def : DefId ) -> DefKind ;
190
190
fn def_path ( & self , def : DefId ) -> DefPath ;
191
191
fn def_path_hash ( & self , def : DefId ) -> DefPathHash ;
192
- fn all_def_path_hashes_and_def_ids ( & self , cnum : CrateNum ) -> Vec < ( DefPathHash , DefId ) > ;
193
- fn num_def_ids ( & self , cnum : CrateNum ) -> usize ;
194
192
fn def_path_hash_to_def_id (
195
193
& self ,
196
194
cnum : CrateNum ,
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ use rustc_hir::{
13
13
} ;
14
14
use rustc_interface:: interface;
15
15
use rustc_middle:: hir:: map:: Map ;
16
- use rustc_middle:: middle:: cstore:: CrateStore ;
17
16
use rustc_middle:: middle:: privacy:: AccessLevels ;
18
17
use rustc_middle:: ty:: { ParamEnv , Ty , TyCtxt } ;
19
18
use rustc_resolve as resolve;
You can’t perform that action at this time.
0 commit comments