@@ -155,7 +155,7 @@ use std::iter::once;
155
155
use smallvec:: SmallVec ;
156
156
157
157
use rustc_apfloat:: ieee:: { DoubleS , IeeeFloat , SingleS } ;
158
- use rustc_data_structures :: fx :: FxHashSet ;
158
+ use rustc_index :: bit_set :: { BitSet , GrowableBitSet } ;
159
159
use rustc_index:: IndexVec ;
160
160
161
161
use self :: Constructor :: * ;
@@ -546,7 +546,7 @@ impl Slice {
546
546
// therefore `Presence::Seen` in the column.
547
547
let mut min_var_len = usize:: MAX ;
548
548
// Tracks the fixed-length slices we've seen, to mark them as `Presence::Seen`.
549
- let mut seen_fixed_lens = FxHashSet :: default ( ) ;
549
+ let mut seen_fixed_lens = GrowableBitSet :: new_empty ( ) ;
550
550
match & mut max_slice {
551
551
VarLen ( max_prefix_len, max_suffix_len) => {
552
552
// A length larger than any fixed-length slice encountered.
@@ -614,7 +614,7 @@ impl Slice {
614
614
615
615
smaller_lengths. map ( FixedLen ) . chain ( once ( max_slice) ) . map ( move |kind| {
616
616
let arity = kind. arity ( ) ;
617
- let seen = if min_var_len <= arity || seen_fixed_lens. contains ( & arity) {
617
+ let seen = if min_var_len <= arity || seen_fixed_lens. contains ( arity) {
618
618
Presence :: Seen
619
619
} else {
620
620
Presence :: Unseen
@@ -906,12 +906,15 @@ impl<Cx: MatchCx> ConstructorSet<Cx> {
906
906
}
907
907
}
908
908
ConstructorSet :: Variants { variants, non_exhaustive } => {
909
- let seen_set: FxHashSet < _ > = seen. iter ( ) . map ( |c| c. as_variant ( ) . unwrap ( ) ) . collect ( ) ;
909
+ let mut seen_set: BitSet < _ > = BitSet :: new_empty ( variants. len ( ) ) ;
910
+ for idx in seen. iter ( ) . map ( |c| c. as_variant ( ) . unwrap ( ) ) {
911
+ seen_set. insert ( idx) ;
912
+ }
910
913
let mut skipped_a_hidden_variant = false ;
911
914
912
915
for ( idx, visibility) in variants. iter_enumerated ( ) {
913
916
let ctor = Variant ( idx) ;
914
- if seen_set. contains ( & idx) {
917
+ if seen_set. contains ( idx) {
915
918
present. push ( ctor) ;
916
919
} else {
917
920
// We only put visible variants directly into `missing`.
0 commit comments