Skip to content

Commit 1d662c9

Browse files
committed
Remove Partial/Ord from AdtDef
1 parent 459ea32 commit 1d662c9

File tree

1 file changed

+1
-16
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+1
-16
lines changed

compiler/rustc_middle/src/ty/adt.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use rustc_span::symbol::sym;
1818
use rustc_target::abi::{ReprOptions, VariantIdx, FIRST_VARIANT};
1919

2020
use std::cell::RefCell;
21-
use std::cmp::Ordering;
2221
use std::hash::{Hash, Hasher};
2322
use std::ops::Range;
2423
use std::str;
@@ -102,20 +101,6 @@ pub struct AdtDefData {
102101
repr: ReprOptions,
103102
}
104103

105-
impl PartialOrd for AdtDefData {
106-
fn partial_cmp(&self, other: &AdtDefData) -> Option<Ordering> {
107-
Some(self.cmp(other))
108-
}
109-
}
110-
111-
/// There should be only one AdtDef for each `did`, therefore
112-
/// it is fine to implement `Ord` only based on `did`.
113-
impl Ord for AdtDefData {
114-
fn cmp(&self, other: &AdtDefData) -> Ordering {
115-
self.did.cmp(&other.did)
116-
}
117-
}
118-
119104
impl PartialEq for AdtDefData {
120105
#[inline]
121106
fn eq(&self, other: &Self) -> bool {
@@ -180,7 +165,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for AdtDefData {
180165
}
181166
}
182167

183-
#[derive(Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, HashStable)]
168+
#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)]
184169
#[rustc_pass_by_value]
185170
pub struct AdtDef<'tcx>(pub Interned<'tcx, AdtDefData>);
186171

0 commit comments

Comments
 (0)