Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e87d108

Browse files
committed
Remove Ord from BoundTy
1 parent dd9fe01 commit e87d108

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
@@ -868,7 +868,7 @@ impl<'tcx> InlineConstArgs<'tcx> {
868868
}
869869
}
870870

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

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

1413-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)]
1413+
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, TyEncodable, TyDecodable)]
14141414
#[derive(HashStable)]
14151415
pub enum BoundTyKind {
14161416
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)