@@ -155,7 +155,7 @@ use std::iter::once;
155155use smallvec:: SmallVec ;
156156
157157use rustc_apfloat:: ieee:: { DoubleS , IeeeFloat , SingleS } ;
158- use rustc_data_structures :: fx :: FxHashSet ;
158+ use rustc_index :: bit_set :: { BitSet , GrowableBitSet } ;
159159use rustc_index:: IndexVec ;
160160
161161use self :: Constructor :: * ;
@@ -546,7 +546,7 @@ impl Slice {
546546 // therefore `Presence::Seen` in the column.
547547 let mut min_var_len = usize:: MAX ;
548548 // 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 ( ) ;
550550 match & mut max_slice {
551551 VarLen ( max_prefix_len, max_suffix_len) => {
552552 // A length larger than any fixed-length slice encountered.
@@ -614,7 +614,7 @@ impl Slice {
614614
615615 smaller_lengths. map ( FixedLen ) . chain ( once ( max_slice) ) . map ( move |kind| {
616616 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) {
618618 Presence :: Seen
619619 } else {
620620 Presence :: Unseen
@@ -906,12 +906,15 @@ impl<Cx: MatchCx> ConstructorSet<Cx> {
906906 }
907907 }
908908 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+ }
910913 let mut skipped_a_hidden_variant = false ;
911914
912915 for ( idx, visibility) in variants. iter_enumerated ( ) {
913916 let ctor = Variant ( idx) ;
914- if seen_set. contains ( & idx) {
917+ if seen_set. contains ( idx) {
915918 present. push ( ctor) ;
916919 } else {
917920 // We only put visible variants directly into `missing`.
0 commit comments