From 5f6de3d40238aa253b7dc4dd037599ef9e29999f Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Mon, 18 Sep 2017 22:19:00 -0700 Subject: [PATCH] Derive additional traits for Infallible. --- src/libcore/convert.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index d3a86f7f3e3..9730de0efe9 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -48,8 +48,6 @@ #![stable(feature = "rust1", since = "1.0.0")] -use fmt; - /// A type used as the error type for implementations of fallible conversion /// traits in cases where conversions cannot actually fail. /// @@ -57,15 +55,9 @@ use fmt; /// It is used only to satisfy trait signatures that expect an error type, and /// signals to both the compiler and the user that the error case is impossible. #[unstable(feature = "try_from", issue = "33417")] +#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub enum Infallible {} -#[unstable(feature = "try_from", issue = "33417")] -impl fmt::Debug for Infallible { - fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { - match *self {} - } -} - /// A cheap reference-to-reference conversion. Used to convert a value to a /// reference value within generic code. ///