From 86497e6376232901c4df8ec2d3372609dd2a1232 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 12 Jun 2025 22:24:39 +0000 Subject: [PATCH] Don't use BTreeMap for mapped_consts --- compiler/rustc_trait_selection/src/traits/util.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs index 035fd38c48aa..3fafde45e646 100644 --- a/compiler/rustc_trait_selection/src/traits/util.rs +++ b/compiler/rustc_trait_selection/src/traits/util.rs @@ -1,4 +1,4 @@ -use std::collections::{BTreeMap, VecDeque}; +use std::collections::VecDeque; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_hir::LangItem; @@ -219,7 +219,7 @@ pub struct BoundVarReplacer<'a, 'tcx> { // the `var` (but we *could* bring that into scope if we were to track them as we pass them). mapped_regions: FxIndexMap, mapped_types: FxIndexMap, - mapped_consts: BTreeMap, + mapped_consts: FxIndexMap, // The current depth relative to *this* folding, *not* the entire normalization. In other words, // the depth of binders we've passed here. current_index: ty::DebruijnIndex, @@ -239,12 +239,12 @@ impl<'a, 'tcx> BoundVarReplacer<'a, 'tcx> { T, FxIndexMap, FxIndexMap, - BTreeMap, + FxIndexMap, ) { let mapped_regions: FxIndexMap = FxIndexMap::default(); let mapped_types: FxIndexMap = FxIndexMap::default(); - let mapped_consts: BTreeMap = BTreeMap::new(); + let mapped_consts: FxIndexMap = FxIndexMap::default(); let mut replacer = BoundVarReplacer { infcx, @@ -363,7 +363,7 @@ pub struct PlaceholderReplacer<'a, 'tcx> { infcx: &'a InferCtxt<'tcx>, mapped_regions: FxIndexMap, mapped_types: FxIndexMap, - mapped_consts: BTreeMap, + mapped_consts: FxIndexMap, universe_indices: &'a [Option], current_index: ty::DebruijnIndex, } @@ -373,7 +373,7 @@ impl<'a, 'tcx> PlaceholderReplacer<'a, 'tcx> { infcx: &'a InferCtxt<'tcx>, mapped_regions: FxIndexMap, mapped_types: FxIndexMap, - mapped_consts: BTreeMap, + mapped_consts: FxIndexMap, universe_indices: &'a [Option], value: T, ) -> T {