From b94bcbf56eab163517e8ffc93888284b8dbb6238 Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Tue, 30 Dec 2014 14:44:26 -0800 Subject: Stabilize cmp This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as `#[stable]`, as well as the majorify of manual implementaitons of these traits. The traits match the [reform RFC](https://github.com/rust-lang/rfcs/pull/439). Along the way, two changes are made: * The recently-added type parameters for `Ord` and `Eq` are removed. These were mistakenly added while adding them to `PartialOrd` and `PartialEq`, but they don't make sense given the laws that are required for (and use cases for) `Ord` and `Eq`. * More explicit laws are added for `PartialEq` and `PartialOrd`, connecting them to their associated mathematical concepts. In the future, many of the impls should be generalized; see since generalizing later is not a breaking change. [breaking-change] --- src/liballoc/arc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/liballoc/arc.rs') diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 21c47cdf3d7..f6f83f22f92 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -458,7 +458,7 @@ impl Drop for Weak { } } -#[unstable = "waiting on PartialEq"] +#[stable] impl PartialEq for Arc { /// Equality for two `Arc`s. /// @@ -490,7 +490,7 @@ impl PartialEq for Arc { /// ``` fn ne(&self, other: &Arc) -> bool { *(*self) != *(*other) } } -#[unstable = "waiting on PartialOrd"] +#[stable] impl PartialOrd for Arc { /// Partial comparison for two `Arc`s. /// @@ -569,11 +569,11 @@ impl PartialOrd for Arc { /// ``` fn ge(&self, other: &Arc) -> bool { *(*self) >= *(*other) } } -#[unstable = "waiting on Ord"] +#[stable] impl Ord for Arc { fn cmp(&self, other: &Arc) -> Ordering { (**self).cmp(&**other) } } -#[unstable = "waiting on Eq"] +#[stable] impl Eq for Arc {} impl fmt::Show for Arc { -- cgit 1.4.1-3-g733a5