diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-08-23 02:07:50 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-08-23 02:10:22 +0200 |
| commit | 5e22e3025ce0079ff54f17ebe99e9d00a34a8cf6 (patch) | |
| tree | 172606eda4ef2651f174a00bf20bbdf365605bac | |
| parent | 3c5a0fa45b5e2786b6e64e27f48cd129e7aefdbd (diff) | |
| download | rust-5e22e3025ce0079ff54f17ebe99e9d00a34a8cf6.tar.gz rust-5e22e3025ce0079ff54f17ebe99e9d00a34a8cf6.zip | |
Implement more traits for `std::io::ErrorKind`
This makes it possible to use it as key in various maps.
| -rw-r--r-- | src/libstd/io/error.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 5333b0a531e..aa6ec75e3fc 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -83,7 +83,7 @@ struct Custom { /// It is used with the [`io::Error`] type. /// /// [`io::Error`]: struct.Error.html -#[derive(Copy, PartialEq, Eq, Clone, Debug)] +#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated)] pub enum ErrorKind { @@ -152,10 +152,6 @@ pub enum ErrorKind { /// Interrupted operations can typically be retried. #[stable(feature = "rust1", since = "1.0.0")] Interrupted, - /// Any I/O error not part of this list. - #[stable(feature = "rust1", since = "1.0.0")] - Other, - /// An error returned when an operation could not be completed because an /// "end of file" was reached prematurely. /// @@ -164,8 +160,12 @@ pub enum ErrorKind { /// read. #[stable(feature = "read_exact", since = "1.6.0")] UnexpectedEof, - /// Any I/O error not part of this list. + #[stable(feature = "rust1", since = "1.0.0")] + Other, + + /// A marker variant that tells the compiler that users of this enum cannot + /// match it exhaustively. #[unstable(feature = "io_error_internals", reason = "better expressed through extensible enums that this \ enum cannot be exhaustively matched against", |
