diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index da74a3e1216..57a675e4453 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -868,7 +868,7 @@ impl<'tcx> InlineConstArgs<'tcx> { } } -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, TyEncodable, TyDecodable)] #[derive(HashStable)] pub enum BoundVariableKind { Ty(BoundTyKind), @@ -1403,14 +1403,14 @@ impl ParamConst { } } -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)] #[derive(HashStable)] pub struct BoundTy { pub var: BoundVar, pub kind: BoundTyKind, } -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, TyEncodable, TyDecodable)] #[derive(HashStable)] pub enum BoundTyKind { Anon, diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs index 3f433a9e919..c9d76aa6ee9 100644 --- a/compiler/rustc_trait_selection/src/traits/util.rs +++ b/compiler/rustc_trait_selection/src/traits/util.rs @@ -2,7 +2,7 @@ use std::collections::BTreeMap; use super::NormalizeExt; use super::{ObligationCause, PredicateObligation, SelectionContext}; -use rustc_data_structures::fx::FxHashSet; +use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_errors::Diag; use rustc_hir::def_id::DefId; use rustc_infer::infer::{InferCtxt, InferOk}; @@ -432,7 +432,7 @@ pub struct BoundVarReplacer<'me, 'tcx> { // 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_types: BTreeMap, + mapped_types: FxIndexMap, mapped_consts: BTreeMap, // The current depth relative to *this* folding, *not* the entire normalization. In other words, // the depth of binders we've passed here. @@ -452,11 +452,11 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> { ) -> ( T, BTreeMap, - BTreeMap, + FxIndexMap, BTreeMap, ) { let mapped_regions: BTreeMap = BTreeMap::new(); - let mapped_types: BTreeMap = BTreeMap::new(); + let mapped_types: FxIndexMap = FxIndexMap::default(); let mapped_consts: BTreeMap = BTreeMap::new(); let mut replacer = BoundVarReplacer { @@ -575,7 +575,7 @@ impl<'tcx> TypeFolder> for BoundVarReplacer<'_, 'tcx> { pub struct PlaceholderReplacer<'me, 'tcx> { infcx: &'me InferCtxt<'tcx>, mapped_regions: BTreeMap, - mapped_types: BTreeMap, + mapped_types: FxIndexMap, mapped_consts: BTreeMap, universe_indices: &'me [Option], current_index: ty::DebruijnIndex, @@ -585,7 +585,7 @@ impl<'me, 'tcx> PlaceholderReplacer<'me, 'tcx> { pub fn replace_placeholders>>( infcx: &'me InferCtxt<'tcx>, mapped_regions: BTreeMap, - mapped_types: BTreeMap, + mapped_types: FxIndexMap, mapped_consts: BTreeMap, universe_indices: &'me [Option], value: T,