diff --git a/src/librustc/traits/project.rs b/src/librustc/traits/project.rs index ae539f07336d53f9920d4c0cb66aa512c07d8c5d..7ae9691194158c7997667525b9fbf2ed7ccd4113 100644 --- a/src/librustc/traits/project.rs +++ b/src/librustc/traits/project.rs @@ -101,7 +101,7 @@ pub struct MismatchedProjectionTypes<'tcx> { pub err: ty::error::TypeError<'tcx> } -#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)] +#[derive(PartialEq, Eq, Debug)] enum ProjectionTyCandidate<'tcx> { // from a where-clause in the env or object type ParamEnv(ty::PolyProjectionPredicate<'tcx>), diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index f52f2ea0f9fc8258b9d93964c6694a1da0cb9e9a..14d33b0729aae2707ec068a6251078bfc29e99eb 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -39,7 +39,6 @@ use serialize::{self, Encodable, Encoder}; use std::cell::RefCell; use std::cmp; -use std::cmp::Ordering; use std::fmt; use std::hash::{Hash, Hasher}; use std::iter::FromIterator; @@ -498,20 +497,6 @@ fn hash(&self, s: &mut H) { } } -impl<'tcx> Ord for TyS<'tcx> { - #[inline] - fn cmp(&self, other: &TyS<'tcx>) -> Ordering { - // (self as *const _).cmp(other as *const _) - (self as *const TyS<'tcx>).cmp(&(other as *const TyS<'tcx>)) - } -} -impl<'tcx> PartialOrd for TyS<'tcx> { - #[inline] - fn partial_cmp(&self, other: &TyS<'tcx>) -> Option { - Some(self.cmp(other)) - } -} - impl<'tcx> TyS<'tcx> { pub fn is_primitive_ty(&self) -> bool { match self.sty { @@ -581,19 +566,6 @@ fn eq(&self, other: &Slice) -> bool { } impl Eq for Slice {} -impl Ord for Slice { - #[inline] - fn cmp(&self, other: &Slice) -> Ordering { - (&self.0 as *const [T]).cmp(&(&other.0 as *const [T])) - } -} -impl PartialOrd for Slice { - #[inline] - fn partial_cmp(&self, other: &Slice) -> Option { - Some(self.cmp(other)) - } -} - impl Hash for Slice { fn hash(&self, s: &mut H) { (self.as_ptr(), self.len()).hash(s) @@ -1128,7 +1100,7 @@ pub struct SubtypePredicate<'tcx> { /// equality between arbitrary types. Processing an instance of /// Form #2 eventually yields one of these `ProjectionPredicate` /// instances to normalize the LHS. -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)] pub struct ProjectionPredicate<'tcx> { pub projection_ty: ProjectionTy<'tcx>, pub ty: Ty<'tcx>, diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 961c2650afdefc995bc256deece40915defc071c..503418b044f4f603e1de9b799a25bc53ed8cb8db 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -645,7 +645,7 @@ pub fn input_types<'a>(&'a self) -> impl DoubleEndedIterator> + 'a /// erase, or otherwise "discharge" these bound regions, we change the /// type from `Binder` to just `T` (see /// e.g. `liberate_late_bound_regions`). -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)] pub struct Binder(pub T); impl Binder { @@ -745,7 +745,7 @@ pub fn split(self, f: F) -> (Binder, Binder) /// Represents the projection of an associated type. In explicit UFCS /// form this would be written `>::N`. -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)] pub struct ProjectionTy<'tcx> { /// The parameters of the associated item. pub substs: &'tcx Substs<'tcx>, diff --git a/src/librustc/ty/subst.rs b/src/librustc/ty/subst.rs index 7c167f69ebd8c063c504cd9c671437f212a0175c..80b113dfdf5a5f2b6404ce66ed4ed53c47fc93a1 100644 --- a/src/librustc/ty/subst.rs +++ b/src/librustc/ty/subst.rs @@ -29,7 +29,7 @@ /// To reduce memory usage, a `Kind` is a interned pointer, /// with the lowest 2 bits being reserved for a tag to /// indicate the type (`Ty` or `Region`) it points to. -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Copy, Clone, PartialEq, Eq, Hash)] pub struct Kind<'tcx> { ptr: NonZero, marker: PhantomData<(Ty<'tcx>, ty::Region<'tcx>)>