1- use rustc_data_structures:: fx:: FxHashSet ;
21use rustc_data_structures:: sync:: Lock ;
32use rustc_hir as hir;
43use rustc_hir:: def_id:: { LocalDefId , CRATE_DEF_ID } ;
54use rustc_hir:: intravisit;
65use rustc_hir:: { HirId , ItemLocalId } ;
6+ use rustc_index:: bit_set:: GrowableBitSet ;
77use rustc_middle:: hir:: map:: Map ;
88use rustc_middle:: hir:: nested_filter;
99use rustc_middle:: ty:: TyCtxt ;
@@ -40,7 +40,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
4040struct HirIdValidator < ' a , ' hir > {
4141 hir_map : Map < ' hir > ,
4242 owner : Option < LocalDefId > ,
43- hir_ids_seen : FxHashSet < ItemLocalId > ,
43+ hir_ids_seen : GrowableBitSet < ItemLocalId > ,
4444 errors : & ' a Lock < Vec < String > > ,
4545}
4646
@@ -80,7 +80,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
8080 if max != self . hir_ids_seen . len ( ) - 1 {
8181 // Collect the missing ItemLocalIds
8282 let missing: Vec < _ > = ( 0 ..=max as u32 )
83- . filter ( |& i| !self . hir_ids_seen . contains ( & ItemLocalId :: from_u32 ( i) ) )
83+ . filter ( |& i| !self . hir_ids_seen . contains ( ItemLocalId :: from_u32 ( i) ) )
8484 . collect ( ) ;
8585
8686 // Try to map those to something more useful
@@ -106,7 +106,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
106106 missing_items,
107107 self . hir_ids_seen
108108 . iter( )
109- . map( |& local_id| HirId { owner, local_id } )
109+ . map( |local_id| HirId { owner, local_id } )
110110 . map( |h| format!( "({:?} {})" , h, self . hir_map. node_to_string( h) ) )
111111 . collect:: <Vec <_>>( )
112112 )
0 commit comments