@@ -37,7 +37,7 @@ use std::fmt::{Debug, Formatter};
3737use std:: ops:: Range ;
3838
3939use rustc_data_structures:: captures:: Captures ;
40- use rustc_data_structures:: fx:: { FxHashMap , FxIndexSet , StdEntry } ;
40+ use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap , FxIndexSet , IndexEntry } ;
4141use rustc_data_structures:: stack:: ensure_sufficient_stack;
4242use rustc_index:: IndexVec ;
4343use rustc_index:: bit_set:: BitSet ;
@@ -421,12 +421,12 @@ rustc_index::newtype_index!(
421421pub struct StateData < V > {
422422 bottom : V ,
423423 /// This map only contains values that are not `⊥`.
424- map : FxHashMap < ValueIndex , V > ,
424+ map : FxIndexMap < ValueIndex , V > ,
425425}
426426
427427impl < V : HasBottom > StateData < V > {
428428 fn new ( ) -> StateData < V > {
429- StateData { bottom : V :: BOTTOM , map : FxHashMap :: default ( ) }
429+ StateData { bottom : V :: BOTTOM , map : FxIndexMap :: default ( ) }
430430 }
431431
432432 fn get ( & self , idx : ValueIndex ) -> & V {
@@ -435,7 +435,7 @@ impl<V: HasBottom> StateData<V> {
435435
436436 fn insert ( & mut self , idx : ValueIndex , elem : V ) {
437437 if elem. is_bottom ( ) {
438- self . map . remove ( & idx) ;
438+ self . map . shift_remove ( & idx) ;
439439 } else {
440440 self . map . insert ( idx, elem) ;
441441 }
@@ -455,14 +455,13 @@ impl<V: Clone> Clone for StateData<V> {
455455impl < V : JoinSemiLattice + Clone + HasBottom > JoinSemiLattice for StateData < V > {
456456 fn join ( & mut self , other : & Self ) -> bool {
457457 let mut changed = false ;
458- #[ allow( rustc:: potential_query_instability) ]
459458 for ( i, v) in other. map . iter ( ) {
460459 match self . map . entry ( * i) {
461- StdEntry :: Vacant ( e) => {
460+ IndexEntry :: Vacant ( e) => {
462461 e. insert ( v. clone ( ) ) ;
463462 changed = true
464463 }
465- StdEntry :: Occupied ( e) => changed |= e. into_mut ( ) . join ( v) ,
464+ IndexEntry :: Occupied ( e) => changed |= e. into_mut ( ) . join ( v) ,
466465 }
467466 }
468467 changed
0 commit comments