Skip to content

Commit d005d91

Browse files
committed
Improved bounds for cmp::Reverse
1 parent dabff15 commit d005d91

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libcore/cmp.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,19 @@ impl Ordering {
337337
/// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]);
338338
/// ```
339339
#[derive(PartialEq, Eq, Debug)]
340-
#[stable(feature = "rust1", since = "1.8.0")]
341-
pub struct Reverse<T: Ord + PartialOrd + Eq + PartialEq>(pub T);
340+
#[stable(feature = "rust1", since = "1.18.0")]
341+
pub struct Reverse<T>(pub T);
342342

343-
#[stable(feature = "rust1", since = "1.8.0")]
344-
impl<T: Ord + PartialOrd + Eq + PartialEq> PartialOrd for Reverse<T> {
343+
#[stable(feature = "rust1", since = "1.18.0")]
344+
impl<T: PartialOrd> PartialOrd for Reverse<T> {
345345
#[inline]
346346
fn partial_cmp(&self, other: &Reverse<T>) -> Option<Ordering> {
347347
other.0.partial_cmp(&self.0)
348348
}
349349
}
350350

351-
#[stable(feature = "rust1", since = "1.8.0")]
352-
impl<T: Ord + PartialOrd + Eq + PartialEq> Ord for Reverse<T> {
351+
#[stable(feature = "rust1", since = "1.18.0")]
352+
impl<T: Ord> Ord for Reverse<T> {
353353
#[inline]
354354
fn cmp(&self, other: &Reverse<T>) -> Ordering {
355355
other.0.cmp(&self.0)

0 commit comments

Comments
 (0)