Skip to content

Commit 5f6de3d

Browse files
committed
Derive additional traits for Infallible.
1 parent 93a56cd commit 5f6de3d

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/libcore/convert.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,16 @@
4848
4949
#![stable(feature = "rust1", since = "1.0.0")]
5050

51-
use fmt;
52-
5351
/// A type used as the error type for implementations of fallible conversion
5452
/// traits in cases where conversions cannot actually fail.
5553
///
5654
/// Because `Infallible` has no variants, a value of this type can never exist.
5755
/// It is used only to satisfy trait signatures that expect an error type, and
5856
/// signals to both the compiler and the user that the error case is impossible.
5957
#[unstable(feature = "try_from", issue = "33417")]
58+
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6059
pub enum Infallible {}
6160

62-
#[unstable(feature = "try_from", issue = "33417")]
63-
impl fmt::Debug for Infallible {
64-
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
65-
match *self {}
66-
}
67-
}
68-
6961
/// A cheap reference-to-reference conversion. Used to convert a value to a
7062
/// reference value within generic code.
7163
///

0 commit comments

Comments
 (0)