diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2017-03-22 14:16:41 +0100 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2017-03-22 14:16:41 +0100 |
commit | d005d917783b8f753b4ee2f79f03e2212e519d01 (patch) | |
tree | 09c7933bf5dcb8ae22d3d26453a873f81d43e348 /src/libcore/cmp.rs | |
parent | dabff151426d0cf6f8a779c15be459f7bd457a4c (diff) | |
download | rust-d005d917783b8f753b4ee2f79f03e2212e519d01.tar.gz |
Improved bounds for cmp::Reverse
Diffstat (limited to 'src/libcore/cmp.rs')
-rw-r--r-- | src/libcore/cmp.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index d787a0833c7..751932a6105 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -337,19 +337,19 @@ impl Ordering { /// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]); /// ``` #[derive(PartialEq, Eq, Debug)] -#[stable(feature = "rust1", since = "1.8.0")] -pub struct Reverse<T: Ord + PartialOrd + Eq + PartialEq>(pub T); +#[stable(feature = "rust1", since = "1.18.0")] +pub struct Reverse<T>(pub T); -#[stable(feature = "rust1", since = "1.8.0")] -impl<T: Ord + PartialOrd + Eq + PartialEq> PartialOrd for Reverse<T> { +#[stable(feature = "rust1", since = "1.18.0")] +impl<T: PartialOrd> PartialOrd for Reverse<T> { #[inline] fn partial_cmp(&self, other: &Reverse<T>) -> Option<Ordering> { other.0.partial_cmp(&self.0) } } -#[stable(feature = "rust1", since = "1.8.0")] -impl<T: Ord + PartialOrd + Eq + PartialEq> Ord for Reverse<T> { +#[stable(feature = "rust1", since = "1.18.0")] +impl<T: Ord> Ord for Reverse<T> { #[inline] fn cmp(&self, other: &Reverse<T>) -> Ordering { other.0.cmp(&self.0) |