Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Feb 17, 2019
1 parent b2cf9a0 commit cf26754
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/libcore/convert.rs
Expand Up @@ -41,6 +41,8 @@

#![stable(feature = "rust1", since = "1.0.0")]

use fmt;

/// An identity function.
///
/// Two things are important to note about this function:
Expand Down Expand Up @@ -571,8 +573,6 @@ impl Clone for Infallible {
}
}

use fmt;

#[stable(feature = "convert_infallible", since = "1.34.0")]
impl fmt::Debug for Infallible {
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand All @@ -597,6 +597,20 @@ impl PartialEq for Infallible {
#[stable(feature = "convert_infallible", since = "1.34.0")]
impl Eq for Infallible {}

#[stable(feature = "convert_infallible", since = "1.34.0")]
impl PartialOrd for Infallible {
fn partial_cmp(&self, _other: &Self) -> Option<crate::cmp::Ordering> {
match *self {}
}
}

#[stable(feature = "convert_infallible", since = "1.34.0")]
impl Ord for Infallible {
fn cmp(&self, _other: &Self) -> crate::cmp::Ordering {
match *self {}
}
}

#[stable(feature = "convert_infallible", since = "1.34.0")]
impl From<!> for Infallible {
fn from(x: !) -> Self {
Expand Down

0 comments on commit cf26754

Please sign in to comment.