diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-03-21 14:06:51 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-03-27 14:02:16 +0000 |
| commit | 1d662c9eee794d990f1faa106e96d5bf6b42e0c7 (patch) | |
| tree | 2f58c9075164062b85719b7fd30e321f41b1ae54 | |
| parent | 459ea32a278b64c7a0dbf63ca258786d6fb89a1a (diff) | |
| download | rust-1d662c9eee794d990f1faa106e96d5bf6b42e0c7.tar.gz rust-1d662c9eee794d990f1faa106e96d5bf6b42e0c7.zip | |
Remove `Partial/Ord` from `AdtDef`
| -rw-r--r-- | compiler/rustc_middle/src/ty/adt.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index a7144316769..a7f1ba46b61 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -18,7 +18,6 @@ use rustc_span::symbol::sym; use rustc_target::abi::{ReprOptions, VariantIdx, FIRST_VARIANT}; use std::cell::RefCell; -use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use std::ops::Range; use std::str; @@ -102,20 +101,6 @@ pub struct AdtDefData { repr: ReprOptions, } -impl PartialOrd for AdtDefData { - fn partial_cmp(&self, other: &AdtDefData) -> Option<Ordering> { - Some(self.cmp(other)) - } -} - -/// There should be only one AdtDef for each `did`, therefore -/// it is fine to implement `Ord` only based on `did`. -impl Ord for AdtDefData { - fn cmp(&self, other: &AdtDefData) -> Ordering { - self.did.cmp(&other.did) - } -} - impl PartialEq for AdtDefData { #[inline] fn eq(&self, other: &Self) -> bool { @@ -180,7 +165,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for AdtDefData { } } -#[derive(Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, HashStable)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)] #[rustc_pass_by_value] pub struct AdtDef<'tcx>(pub Interned<'tcx, AdtDefData>); |
