11use super :: potentially_plural_count;
22use crate :: errors:: { LifetimesOrBoundsMismatchOnTrait , MethodShouldReturnFuture } ;
33use hir:: def_id:: { DefId , DefIdMap , LocalDefId } ;
4- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
4+ use rustc_data_structures:: fx:: { FxHashSet , FxIndexMap , FxIndexSet } ;
55use rustc_errors:: { codes:: * , pluralize, struct_span_code_err, Applicability , ErrorGuaranteed } ;
66use rustc_hir as hir;
77use rustc_hir:: def:: { DefKind , Res } ;
@@ -392,7 +392,7 @@ fn compare_method_predicate_entailment<'tcx>(
392392
393393struct RemapLateBound < ' a , ' tcx > {
394394 tcx : TyCtxt < ' tcx > ,
395- mapping : & ' a FxHashMap < ty:: BoundRegionKind , ty:: BoundRegionKind > ,
395+ mapping : & ' a FxIndexMap < ty:: BoundRegionKind , ty:: BoundRegionKind > ,
396396}
397397
398398impl < ' tcx > TypeFolder < TyCtxt < ' tcx > > for RemapLateBound < ' _ , ' tcx > {
@@ -553,7 +553,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
553553 // prove below that the hidden types are well formed.
554554 let universe = infcx. create_next_universe ( ) ;
555555 let mut idx = 0 ;
556- let mapping: FxHashMap < _ , _ > = collector
556+ let mapping: FxIndexMap < _ , _ > = collector
557557 . types
558558 . iter ( )
559559 . map ( |( _, & ( ty, _) ) | {
@@ -690,7 +690,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
690690 // contains `def_id`'s early-bound regions.
691691 let id_args = GenericArgs :: identity_for_item ( tcx, def_id) ;
692692 debug ! ( ?id_args, ?args) ;
693- let map: FxHashMap < _ , _ > = std:: iter:: zip ( args, id_args)
693+ let map: FxIndexMap < _ , _ > = std:: iter:: zip ( args, id_args)
694694 . skip ( tcx. generics_of ( trait_m. def_id ) . count ( ) )
695695 . filter_map ( |( a, b) | Some ( ( a. as_region ( ) ?, b. as_region ( ) ?) ) )
696696 . collect ( ) ;
@@ -766,7 +766,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
766766
767767struct ImplTraitInTraitCollector < ' a , ' tcx > {
768768 ocx : & ' a ObligationCtxt < ' a , ' tcx > ,
769- types : FxHashMap < DefId , ( Ty < ' tcx > , ty:: GenericArgsRef < ' tcx > ) > ,
769+ types : FxIndexMap < DefId , ( Ty < ' tcx > , ty:: GenericArgsRef < ' tcx > ) > ,
770770 span : Span ,
771771 param_env : ty:: ParamEnv < ' tcx > ,
772772 body_id : LocalDefId ,
@@ -779,7 +779,7 @@ impl<'a, 'tcx> ImplTraitInTraitCollector<'a, 'tcx> {
779779 param_env : ty:: ParamEnv < ' tcx > ,
780780 body_id : LocalDefId ,
781781 ) -> Self {
782- ImplTraitInTraitCollector { ocx, types : FxHashMap :: default ( ) , span, param_env, body_id }
782+ ImplTraitInTraitCollector { ocx, types : FxIndexMap :: default ( ) , span, param_env, body_id }
783783 }
784784}
785785
@@ -838,7 +838,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
838838
839839struct RemapHiddenTyRegions < ' tcx > {
840840 tcx : TyCtxt < ' tcx > ,
841- map : FxHashMap < ty:: Region < ' tcx > , ty:: Region < ' tcx > > ,
841+ map : FxIndexMap < ty:: Region < ' tcx > , ty:: Region < ' tcx > > ,
842842 num_trait_args : usize ,
843843 num_impl_args : usize ,
844844 def_id : DefId ,
0 commit comments