Skip to content

Commit

Permalink
auto merge of #14579 : alexcrichton/rust/more-eq-renamings, r=thestinger
Browse files Browse the repository at this point in the history
This completes the last stage of the renaming of the comparison hierarchy of
traits. This change renames TotalEq to Eq and TotalOrd to Ord.

In the future the new Eq/Ord will be filled out with their appropriate methods,
but for now this change is purely a renaming change.

This continues the work of #12517, continuing the work in #14534. This patch accomplishes the final rename of `TotalEq` to `TotalOrd`. I wanted to get this patch landed ASAP so we don't have to deal much with "where did `Eq` and `Ord` go?"

I have yet to do another pruning pass over the compiler to change all usage of `PartialEq` to `Eq` where appropriate. I will do this soon as well.
  • Loading branch information
bors committed Jun 1, 2014
2 parents c605c2b + bba701c commit 1527dab
Show file tree
Hide file tree
Showing 83 changed files with 436 additions and 431 deletions.
6 changes: 3 additions & 3 deletions src/liballoc/owned.rs
Expand Up @@ -12,7 +12,7 @@

use core::any::{Any, AnyRefExt};
use core::clone::Clone;
use core::cmp::{PartialEq, PartialOrd, TotalEq, TotalOrd, Ordering};
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
use core::default::Default;
use core::fmt;
use core::intrinsics;
Expand Down Expand Up @@ -67,11 +67,11 @@ impl<T:PartialOrd> PartialOrd for Box<T> {
#[inline]
fn gt(&self, other: &Box<T>) -> bool { *(*self) > *(*other) }
}
impl<T: TotalOrd> TotalOrd for Box<T> {
impl<T: Ord> Ord for Box<T> {
#[inline]
fn cmp(&self, other: &Box<T>) -> Ordering { (**self).cmp(*other) }
}
impl<T: TotalEq> TotalEq for Box<T> {}
impl<T: Eq> Eq for Box<T> {}

/// Extension methods for an owning `Any` trait object
pub trait AnyOwnExt {
Expand Down
6 changes: 3 additions & 3 deletions src/liballoc/rc.rs
Expand Up @@ -26,7 +26,7 @@ pointers, and then storing the parent pointers as `Weak` pointers.
use core::mem::transmute;
use core::cell::Cell;
use core::clone::Clone;
use core::cmp::{PartialEq, PartialOrd, TotalEq, TotalOrd, Ordering};
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
use core::kinds::marker;
use core::ops::{Deref, Drop};
use core::option::{Option, Some, None};
Expand Down Expand Up @@ -157,7 +157,7 @@ impl<T: PartialEq> PartialEq for Rc<T> {
fn ne(&self, other: &Rc<T>) -> bool { **self != **other }
}

impl<T: TotalEq> TotalEq for Rc<T> {}
impl<T: Eq> Eq for Rc<T> {}

impl<T: PartialOrd> PartialOrd for Rc<T> {
#[inline(always)]
Expand All @@ -173,7 +173,7 @@ impl<T: PartialOrd> PartialOrd for Rc<T> {
fn ge(&self, other: &Rc<T>) -> bool { **self >= **other }
}

impl<T: TotalOrd> TotalOrd for Rc<T> {
impl<T: Ord> Ord for Rc<T> {
#[inline]
fn cmp(&self, other: &Rc<T>) -> Ordering { (**self).cmp(&**other) }
}
Expand Down

0 comments on commit 1527dab

Please sign in to comment.