@@ -3,7 +3,7 @@ use std::ops::Range;
33
44use rustc_abi:: { FieldIdx , VariantIdx } ;
55use rustc_data_structures:: captures:: Captures ;
6- use rustc_data_structures:: fx:: { FxHashMap , FxIndexSet , StdEntry } ;
6+ use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap , FxIndexSet , IndexEntry } ;
77use rustc_data_structures:: stack:: ensure_sufficient_stack;
88use rustc_index:: IndexVec ;
99use rustc_index:: bit_set:: BitSet ;
@@ -36,12 +36,12 @@ rustc_index::newtype_index!(
3636pub struct StateData < V > {
3737 bottom : V ,
3838 /// This map only contains values that are not `⊥`.
39- map : FxHashMap < ValueIndex , V > ,
39+ map : FxIndexMap < ValueIndex , V > ,
4040}
4141
4242impl < V : HasBottom > StateData < V > {
4343 fn new ( ) -> StateData < V > {
44- StateData { bottom : V :: BOTTOM , map : FxHashMap :: default ( ) }
44+ StateData { bottom : V :: BOTTOM , map : FxIndexMap :: default ( ) }
4545 }
4646
4747 fn get ( & self , idx : ValueIndex ) -> & V {
@@ -50,7 +50,7 @@ impl<V: HasBottom> StateData<V> {
5050
5151 fn insert ( & mut self , idx : ValueIndex , elem : V ) {
5252 if elem. is_bottom ( ) {
53- self . map . remove ( & idx) ;
53+ self . map . shift_remove ( & idx) ;
5454 } else {
5555 self . map . insert ( idx, elem) ;
5656 }
@@ -70,14 +70,13 @@ impl<V: Clone> Clone for StateData<V> {
7070impl < V : JoinSemiLattice + Clone + HasBottom > JoinSemiLattice for StateData < V > {
7171 fn join ( & mut self , other : & Self ) -> bool {
7272 let mut changed = false ;
73- #[ allow( rustc:: potential_query_instability) ]
7473 for ( i, v) in other. map . iter ( ) {
7574 match self . map . entry ( * i) {
76- StdEntry :: Vacant ( e) => {
75+ IndexEntry :: Vacant ( e) => {
7776 e. insert ( v. clone ( ) ) ;
7877 changed = true
7978 }
80- StdEntry :: Occupied ( e) => changed |= e. into_mut ( ) . join ( v) ,
79+ IndexEntry :: Occupied ( e) => changed |= e. into_mut ( ) . join ( v) ,
8180 }
8281 }
8382 changed
0 commit comments