1
1
use super :: potentially_plural_count;
2
2
use crate :: errors:: { LifetimesOrBoundsMismatchOnTrait , MethodShouldReturnFuture } ;
3
3
use hir:: def_id:: { DefId , DefIdMap , LocalDefId } ;
4
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
4
+ use rustc_data_structures:: fx:: { FxHashSet , FxIndexMap , FxIndexSet } ;
5
5
use rustc_errors:: { codes:: * , pluralize, struct_span_code_err, Applicability , ErrorGuaranteed } ;
6
6
use rustc_hir as hir;
7
7
use rustc_hir:: def:: { DefKind , Res } ;
@@ -392,7 +392,7 @@ fn compare_method_predicate_entailment<'tcx>(
392
392
393
393
struct RemapLateBound < ' a , ' tcx > {
394
394
tcx : TyCtxt < ' tcx > ,
395
- mapping : & ' a FxHashMap < ty:: BoundRegionKind , ty:: BoundRegionKind > ,
395
+ mapping : & ' a FxIndexMap < ty:: BoundRegionKind , ty:: BoundRegionKind > ,
396
396
}
397
397
398
398
impl < ' tcx > TypeFolder < TyCtxt < ' tcx > > for RemapLateBound < ' _ , ' tcx > {
@@ -553,7 +553,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
553
553
// prove below that the hidden types are well formed.
554
554
let universe = infcx. create_next_universe ( ) ;
555
555
let mut idx = 0 ;
556
- let mapping: FxHashMap < _ , _ > = collector
556
+ let mapping: FxIndexMap < _ , _ > = collector
557
557
. types
558
558
. iter ( )
559
559
. map ( |( _, & ( ty, _) ) | {
@@ -690,7 +690,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
690
690
// contains `def_id`'s early-bound regions.
691
691
let id_args = GenericArgs :: identity_for_item ( tcx, def_id) ;
692
692
debug ! ( ?id_args, ?args) ;
693
- let map: FxHashMap < _ , _ > = std:: iter:: zip ( args, id_args)
693
+ let map: FxIndexMap < _ , _ > = std:: iter:: zip ( args, id_args)
694
694
. skip ( tcx. generics_of ( trait_m. def_id ) . count ( ) )
695
695
. filter_map ( |( a, b) | Some ( ( a. as_region ( ) ?, b. as_region ( ) ?) ) )
696
696
. collect ( ) ;
@@ -766,7 +766,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
766
766
767
767
struct ImplTraitInTraitCollector < ' a , ' tcx > {
768
768
ocx : & ' a ObligationCtxt < ' a , ' tcx > ,
769
- types : FxHashMap < DefId , ( Ty < ' tcx > , ty:: GenericArgsRef < ' tcx > ) > ,
769
+ types : FxIndexMap < DefId , ( Ty < ' tcx > , ty:: GenericArgsRef < ' tcx > ) > ,
770
770
span : Span ,
771
771
param_env : ty:: ParamEnv < ' tcx > ,
772
772
body_id : LocalDefId ,
@@ -779,7 +779,7 @@ impl<'a, 'tcx> ImplTraitInTraitCollector<'a, 'tcx> {
779
779
param_env : ty:: ParamEnv < ' tcx > ,
780
780
body_id : LocalDefId ,
781
781
) -> Self {
782
- ImplTraitInTraitCollector { ocx, types : FxHashMap :: default ( ) , span, param_env, body_id }
782
+ ImplTraitInTraitCollector { ocx, types : FxIndexMap :: default ( ) , span, param_env, body_id }
783
783
}
784
784
}
785
785
@@ -838,7 +838,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
838
838
839
839
struct RemapHiddenTyRegions < ' tcx > {
840
840
tcx : TyCtxt < ' tcx > ,
841
- map : FxHashMap < ty:: Region < ' tcx > , ty:: Region < ' tcx > > ,
841
+ map : FxIndexMap < ty:: Region < ' tcx > , ty:: Region < ' tcx > > ,
842
842
num_trait_args : usize ,
843
843
num_impl_args : usize ,
844
844
def_id : DefId ,
0 commit comments