Derive Eq for std::cmp::Ordering, instead of using manual impl.
This allows consts of type Ordering to be used in patterns, and (with feature(adt_const_params)) allows using Orderings as const generic parameters.
This commit is contained in:
parent
461e807801
commit
ba611d55f3
1 changed files with 1 additions and 4 deletions
|
@ -333,7 +333,7 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> {
|
|||
/// let result = 2.cmp(&1);
|
||||
/// assert_eq!(Ordering::Greater, result);
|
||||
/// ```
|
||||
#[derive(Clone, Copy, PartialEq, Debug, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[repr(i8)]
|
||||
pub enum Ordering {
|
||||
|
@ -861,9 +861,6 @@ pub macro Ord($item:item) {
|
|||
/* compiler built-in */
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Eq for Ordering {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Ord for Ordering {
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue