Skip to content

Commit 0882bbb

Browse files
committed
Remove some unused Ord derivations based on DefId
Removes `Ord` and `PartialOrd` from middle::mir::mirsource, inlineasmoperand, terminatorkind, operand, constant, constantkind, and place
1 parent 7bc7be8 commit 0882bbb

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

compiler/rustc_middle/src/mir/mod.rs

+6-16
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl MirPhase {
162162
}
163163

164164
/// Where a specific `mir::Body` comes from.
165-
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
165+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
166166
#[derive(HashStable, TyEncodable, TyDecodable, TypeFoldable)]
167167
pub struct MirSource<'tcx> {
168168
pub instance: InstanceDef<'tcx>,
@@ -1255,17 +1255,7 @@ pub enum AssertKind<O> {
12551255
ResumedAfterPanic(GeneratorKind),
12561256
}
12571257

1258-
#[derive(
1259-
Clone,
1260-
Debug,
1261-
PartialEq,
1262-
PartialOrd,
1263-
TyEncodable,
1264-
TyDecodable,
1265-
Hash,
1266-
HashStable,
1267-
TypeFoldable
1268-
)]
1258+
#[derive(Clone, Debug, PartialEq, TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable)]
12691259
pub enum InlineAsmOperand<'tcx> {
12701260
In {
12711261
reg: InlineAsmRegOrRegClass,
@@ -1747,7 +1737,7 @@ pub struct CopyNonOverlapping<'tcx> {
17471737

17481738
/// A path to a value; something that can be evaluated without
17491739
/// changing or disturbing program state.
1750-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, HashStable)]
1740+
#[derive(Copy, Clone, PartialEq, Eq, Hash, TyEncodable, HashStable)]
17511741
pub struct Place<'tcx> {
17521742
pub local: Local,
17531743

@@ -2072,7 +2062,7 @@ pub struct SourceScopeLocalData {
20722062

20732063
/// These are values that can appear inside an rvalue. They are intentionally
20742064
/// limited to prevent rvalues from being nested in one another.
2075-
#[derive(Clone, PartialEq, PartialOrd, TyEncodable, TyDecodable, Hash, HashStable)]
2065+
#[derive(Clone, PartialEq, TyEncodable, TyDecodable, Hash, HashStable)]
20762066
pub enum Operand<'tcx> {
20772067
/// Copy: The value must be available for use afterwards.
20782068
///
@@ -2500,7 +2490,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
25002490
/// this does not necessarily mean that they are `==` in Rust. In
25012491
/// particular, one must be wary of `NaN`!
25022492
2503-
#[derive(Clone, Copy, PartialEq, PartialOrd, TyEncodable, TyDecodable, Hash, HashStable)]
2493+
#[derive(Clone, Copy, PartialEq, TyEncodable, TyDecodable, Hash, HashStable)]
25042494
pub struct Constant<'tcx> {
25052495
pub span: Span,
25062496

@@ -2514,7 +2504,7 @@ pub struct Constant<'tcx> {
25142504
pub literal: ConstantKind<'tcx>,
25152505
}
25162506

2517-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, TyEncodable, TyDecodable, Hash, HashStable, Debug)]
2507+
#[derive(Clone, Copy, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable, Debug)]
25182508
#[derive(Lift)]
25192509
pub enum ConstantKind<'tcx> {
25202510
/// This constant came from the type system

compiler/rustc_middle/src/mir/terminator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'a> Iterator for SwitchTargetsIter<'a> {
105105

106106
impl<'a> ExactSizeIterator for SwitchTargetsIter<'a> {}
107107

108-
#[derive(Clone, TyEncodable, TyDecodable, Hash, HashStable, PartialEq, PartialOrd)]
108+
#[derive(Clone, TyEncodable, TyDecodable, Hash, HashStable, PartialEq)]
109109
pub enum TerminatorKind<'tcx> {
110110
/// Block should have one successor in the graph; we jump there.
111111
Goto { target: BasicBlock },

0 commit comments

Comments
 (0)