Skip to content

Commit 98e58c1

Browse files
committed
Remove Ord from BoundTy
1 parent 380387d commit 98e58c1

File tree

2 files changed

+9
-9
lines changed
  • compiler

2 files changed

+9
-9
lines changed

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ impl<'tcx> InlineConstArgs<'tcx> {
867867
}
868868
}
869869

870-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)]
870+
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, TyEncodable, TyDecodable)]
871871
#[derive(HashStable)]
872872
pub enum BoundVariableKind {
873873
Ty(BoundTyKind),
@@ -1402,14 +1402,14 @@ impl ParamConst {
14021402
}
14031403
}
14041404

1405-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable)]
1405+
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)]
14061406
#[derive(HashStable)]
14071407
pub struct BoundTy {
14081408
pub var: BoundVar,
14091409
pub kind: BoundTyKind,
14101410
}
14111411

1412-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)]
1412+
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, TyEncodable, TyDecodable)]
14131413
#[derive(HashStable)]
14141414
pub enum BoundTyKind {
14151415
Anon,

compiler/rustc_trait_selection/src/traits/util.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::BTreeMap;
22

33
use super::NormalizeExt;
44
use super::{ObligationCause, PredicateObligation, SelectionContext};
5-
use rustc_data_structures::fx::FxHashSet;
5+
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
66
use rustc_errors::Diag;
77
use rustc_hir::def_id::DefId;
88
use rustc_infer::infer::{InferCtxt, InferOk};
@@ -432,7 +432,7 @@ pub struct BoundVarReplacer<'me, 'tcx> {
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).
434434
mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
435-
mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
435+
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,
438438
// the depth of binders we've passed here.
@@ -452,11 +452,11 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> {
452452
) -> (
453453
T,
454454
BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
455-
BTreeMap<ty::PlaceholderType, ty::BoundTy>,
455+
FxIndexMap<ty::PlaceholderType, ty::BoundTy>,
456456
BTreeMap<ty::PlaceholderConst, ty::BoundVar>,
457457
) {
458458
let mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion> = BTreeMap::new();
459-
let mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy> = BTreeMap::new();
459+
let mapped_types: FxIndexMap<ty::PlaceholderType, ty::BoundTy> = FxIndexMap::default();
460460
let mapped_consts: BTreeMap<ty::PlaceholderConst, ty::BoundVar> = BTreeMap::new();
461461

462462
let mut replacer = BoundVarReplacer {
@@ -575,7 +575,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for BoundVarReplacer<'_, 'tcx> {
575575
pub struct PlaceholderReplacer<'me, 'tcx> {
576576
infcx: &'me InferCtxt<'tcx>,
577577
mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
578-
mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
578+
mapped_types: FxIndexMap<ty::PlaceholderType, ty::BoundTy>,
579579
mapped_consts: BTreeMap<ty::PlaceholderConst, ty::BoundVar>,
580580
universe_indices: &'me [Option<ty::UniverseIndex>],
581581
current_index: ty::DebruijnIndex,
@@ -585,7 +585,7 @@ impl<'me, 'tcx> PlaceholderReplacer<'me, 'tcx> {
585585
pub fn replace_placeholders<T: TypeFoldable<TyCtxt<'tcx>>>(
586586
infcx: &'me InferCtxt<'tcx>,
587587
mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
588-
mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
588+
mapped_types: FxIndexMap<ty::PlaceholderType, ty::BoundTy>,
589589
mapped_consts: BTreeMap<ty::PlaceholderConst, ty::BoundVar>,
590590
universe_indices: &'me [Option<ty::UniverseIndex>],
591591
value: T,

0 commit comments

Comments
 (0)