1
- use rustc_data_structures:: fx:: FxHashSet ;
2
1
use rustc_data_structures:: sync:: Lock ;
3
2
use rustc_hir as hir;
4
3
use rustc_hir:: def_id:: { LocalDefId , CRATE_DEF_ID } ;
5
4
use rustc_hir:: intravisit;
6
5
use rustc_hir:: { HirId , ItemLocalId } ;
6
+ use rustc_index:: bit_set:: GrowableBitSet ;
7
7
use rustc_middle:: hir:: map:: Map ;
8
8
use rustc_middle:: hir:: nested_filter;
9
9
use rustc_middle:: ty:: TyCtxt ;
@@ -40,7 +40,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
40
40
struct HirIdValidator < ' a , ' hir > {
41
41
hir_map : Map < ' hir > ,
42
42
owner : Option < LocalDefId > ,
43
- hir_ids_seen : FxHashSet < ItemLocalId > ,
43
+ hir_ids_seen : GrowableBitSet < ItemLocalId > ,
44
44
errors : & ' a Lock < Vec < String > > ,
45
45
}
46
46
@@ -80,7 +80,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
80
80
if max != self . hir_ids_seen . len ( ) - 1 {
81
81
// Collect the missing ItemLocalIds
82
82
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) ) )
84
84
. collect ( ) ;
85
85
86
86
// Try to map those to something more useful
@@ -106,7 +106,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
106
106
missing_items,
107
107
self . hir_ids_seen
108
108
. iter( )
109
- . map( |& local_id| HirId { owner, local_id } )
109
+ . map( |local_id| HirId { owner, local_id } )
110
110
. map( |h| format!( "({:?} {})" , h, self . hir_map. node_to_string( h) ) )
111
111
. collect:: <Vec <_>>( )
112
112
)
0 commit comments