From 459ea32a278b64c7a0dbf63ca258786d6fb89a1a Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 21 Mar 2024 14:02:13 +0000 Subject: Remove `Partial/Ord` from `BoundRegion` --- compiler/rustc_trait_selection/src/traits/util.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_trait_selection/src') diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs index c9d76aa6ee9..29d063321a7 100644 --- a/compiler/rustc_trait_selection/src/traits/util.rs +++ b/compiler/rustc_trait_selection/src/traits/util.rs @@ -431,7 +431,7 @@ pub struct BoundVarReplacer<'me, 'tcx> { // These three maps track the bound variable that were replaced by placeholders. It might be // nice to remove these since we already have the `kind` in the placeholder; we really just need // the `var` (but we *could* bring that into scope if we were to track them as we pass them). - mapped_regions: BTreeMap, + mapped_regions: FxIndexMap, mapped_types: FxIndexMap, mapped_consts: BTreeMap, // The current depth relative to *this* folding, *not* the entire normalization. In other words, @@ -451,11 +451,12 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> { value: T, ) -> ( T, - BTreeMap, + FxIndexMap, FxIndexMap, BTreeMap, ) { - let mapped_regions: BTreeMap = BTreeMap::new(); + let mapped_regions: FxIndexMap = + FxIndexMap::default(); let mapped_types: FxIndexMap = FxIndexMap::default(); let mapped_consts: BTreeMap = BTreeMap::new(); @@ -574,7 +575,7 @@ impl<'tcx> TypeFolder> for BoundVarReplacer<'_, 'tcx> { /// The inverse of [`BoundVarReplacer`]: replaces placeholders with the bound vars from which they came. pub struct PlaceholderReplacer<'me, 'tcx> { infcx: &'me InferCtxt<'tcx>, - mapped_regions: BTreeMap, + mapped_regions: FxIndexMap, mapped_types: FxIndexMap, mapped_consts: BTreeMap, universe_indices: &'me [Option], @@ -584,7 +585,7 @@ pub struct PlaceholderReplacer<'me, 'tcx> { impl<'me, 'tcx> PlaceholderReplacer<'me, 'tcx> { pub fn replace_placeholders>>( infcx: &'me InferCtxt<'tcx>, - mapped_regions: BTreeMap, + mapped_regions: FxIndexMap, mapped_types: FxIndexMap, mapped_consts: BTreeMap, universe_indices: &'me [Option], -- cgit 1.4.1-3-g733a5