@@ -431,7 +431,7 @@ pub struct BoundVarReplacer<'me, 'tcx> {
431431 // These three maps track the bound variable that were replaced by placeholders. It might be
432432 // nice to remove these since we already have the `kind` in the placeholder; we really just need
433433 // the `var` (but we *could* bring that into scope if we were to track them as we pass them).
434- mapped_regions : BTreeMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
434+ mapped_regions : FxIndexMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
435435 mapped_types : FxIndexMap < ty:: PlaceholderType , ty:: BoundTy > ,
436436 mapped_consts : BTreeMap < ty:: PlaceholderConst , ty:: BoundVar > ,
437437 // The current depth relative to *this* folding, *not* the entire normalization. In other words,
@@ -451,11 +451,12 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> {
451451 value : T ,
452452 ) -> (
453453 T ,
454- BTreeMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
454+ FxIndexMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
455455 FxIndexMap < ty:: PlaceholderType , ty:: BoundTy > ,
456456 BTreeMap < ty:: PlaceholderConst , ty:: BoundVar > ,
457457 ) {
458- let mapped_regions: BTreeMap < ty:: PlaceholderRegion , ty:: BoundRegion > = BTreeMap :: new ( ) ;
458+ let mapped_regions: FxIndexMap < ty:: PlaceholderRegion , ty:: BoundRegion > =
459+ FxIndexMap :: default ( ) ;
459460 let mapped_types: FxIndexMap < ty:: PlaceholderType , ty:: BoundTy > = FxIndexMap :: default ( ) ;
460461 let mapped_consts: BTreeMap < ty:: PlaceholderConst , ty:: BoundVar > = BTreeMap :: new ( ) ;
461462
@@ -574,7 +575,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for BoundVarReplacer<'_, 'tcx> {
574575/// The inverse of [`BoundVarReplacer`]: replaces placeholders with the bound vars from which they came.
575576pub struct PlaceholderReplacer < ' me , ' tcx > {
576577 infcx : & ' me InferCtxt < ' tcx > ,
577- mapped_regions : BTreeMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
578+ mapped_regions : FxIndexMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
578579 mapped_types : FxIndexMap < ty:: PlaceholderType , ty:: BoundTy > ,
579580 mapped_consts : BTreeMap < ty:: PlaceholderConst , ty:: BoundVar > ,
580581 universe_indices : & ' me [ Option < ty:: UniverseIndex > ] ,
@@ -584,7 +585,7 @@ pub struct PlaceholderReplacer<'me, 'tcx> {
584585impl < ' me , ' tcx > PlaceholderReplacer < ' me , ' tcx > {
585586 pub fn replace_placeholders < T : TypeFoldable < TyCtxt < ' tcx > > > (
586587 infcx : & ' me InferCtxt < ' tcx > ,
587- mapped_regions : BTreeMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
588+ mapped_regions : FxIndexMap < ty:: PlaceholderRegion , ty:: BoundRegion > ,
588589 mapped_types : FxIndexMap < ty:: PlaceholderType , ty:: BoundTy > ,
589590 mapped_consts : BTreeMap < ty:: PlaceholderConst , ty:: BoundVar > ,
590591 universe_indices : & ' me [ Option < ty:: UniverseIndex > ] ,
0 commit comments