File tree Expand file tree Collapse file tree 4 files changed +4
-28
lines changed Expand file tree Collapse file tree 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> {
15921592 self . def_path_hash_unlocked ( index, & mut def_path_hashes)
15931593 }
15941594
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-
16121595 /// Get the `DepNodeIndex` corresponding this crate. The result of this
16131596 /// method is cached in the `dep_node_index` field.
16141597 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 {
456456 pub fn module_expansion_untracked ( & self , def_id : DefId , sess : & Session ) -> ExpnId {
457457 self . get_crate_data ( def_id. krate ) . module_expansion ( def_id. index , sess)
458458 }
459+
460+ pub fn num_def_ids ( & self , cnum : CrateNum ) -> usize {
461+ self . get_crate_data ( cnum) . num_def_ids ( )
462+ }
459463}
460464
461465impl CrateStore for CStore {
@@ -498,14 +502,6 @@ impl CrateStore for CStore {
498502 self . get_crate_data ( def. krate ) . def_path_hash ( def. index )
499503 }
500504
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-
509505 // See `CrateMetadataRef::def_path_hash_to_def_id` for more details
510506 fn def_path_hash_to_def_id (
511507 & self ,
Original file line number Diff line number Diff line change @@ -189,8 +189,6 @@ pub trait CrateStore {
189189 fn def_kind ( & self , def : DefId ) -> DefKind ;
190190 fn def_path ( & self , def : DefId ) -> DefPath ;
191191 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 ;
194192 fn def_path_hash_to_def_id (
195193 & self ,
196194 cnum : CrateNum ,
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ use rustc_hir::{
1313} ;
1414use rustc_interface:: interface;
1515use rustc_middle:: hir:: map:: Map ;
16- use rustc_middle:: middle:: cstore:: CrateStore ;
1716use rustc_middle:: middle:: privacy:: AccessLevels ;
1817use rustc_middle:: ty:: { ParamEnv , Ty , TyCtxt } ;
1918use rustc_resolve as resolve;
You can’t perform that action at this time.
0 commit comments