diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-30 16:25:47 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-30 16:25:47 -0800 |
| commit | 836bcb6ef41a5a347950893ae70fccbe26bca40e (patch) | |
| tree | 9059abfaedddc15470a9474568badcf280b189fa /src/liballoc/boxed.rs | |
| parent | 3c5fd402cf6921d3c5fe25de37522914ec690f60 (diff) | |
| parent | b94bcbf56eab163517e8ffc93888284b8dbb6238 (diff) | |
| download | rust-836bcb6ef41a5a347950893ae70fccbe26bca40e.tar.gz rust-836bcb6ef41a5a347950893ae70fccbe26bca40e.zip | |
rollup merge of #20065: aturon/stab-2-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). In the future, many of the impls should be generalized; see #20063. However, there is no problem stabilizing the less general impls, since generalizing later is not a breaking change. r? @alexcrichton
Diffstat (limited to 'src/liballoc/boxed.rs')
| -rw-r--r-- | src/liballoc/boxed.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 3c6b2d2cbc0..74f0599e486 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -72,12 +72,14 @@ impl<T: Clone> Clone for Box<T> { } } +#[stable] impl<Sized? T: PartialEq> PartialEq for Box<T> { #[inline] fn eq(&self, other: &Box<T>) -> bool { PartialEq::eq(&**self, &**other) } #[inline] fn ne(&self, other: &Box<T>) -> bool { PartialEq::ne(&**self, &**other) } } +#[stable] impl<Sized? T: PartialOrd> PartialOrd for Box<T> { #[inline] fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> { @@ -92,12 +94,14 @@ impl<Sized? T: PartialOrd> PartialOrd for Box<T> { #[inline] fn gt(&self, other: &Box<T>) -> bool { PartialOrd::gt(&**self, &**other) } } +#[stable] impl<Sized? T: Ord> Ord for Box<T> { #[inline] fn cmp(&self, other: &Box<T>) -> Ordering { Ord::cmp(&**self, &**other) } -} + +#[stable]} impl<Sized? T: Eq> Eq for Box<T> {} impl<S: hash::Writer, Sized? T: Hash<S>> Hash<S> for Box<T> { |
