Skip to content

Commit 5e22e30

Browse files
committed
Implement more traits for std::io::ErrorKind
This makes it possible to use it as key in various maps.
1 parent 3c5a0fa commit 5e22e30

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libstd/io/error.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct Custom {
8383
/// It is used with the [`io::Error`] type.
8484
///
8585
/// [`io::Error`]: struct.Error.html
86-
#[derive(Copy, PartialEq, Eq, Clone, Debug)]
86+
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8787
#[stable(feature = "rust1", since = "1.0.0")]
8888
#[allow(deprecated)]
8989
pub enum ErrorKind {
@@ -152,10 +152,6 @@ pub enum ErrorKind {
152152
/// Interrupted operations can typically be retried.
153153
#[stable(feature = "rust1", since = "1.0.0")]
154154
Interrupted,
155-
/// Any I/O error not part of this list.
156-
#[stable(feature = "rust1", since = "1.0.0")]
157-
Other,
158-
159155
/// An error returned when an operation could not be completed because an
160156
/// "end of file" was reached prematurely.
161157
///
@@ -164,8 +160,12 @@ pub enum ErrorKind {
164160
/// read.
165161
#[stable(feature = "read_exact", since = "1.6.0")]
166162
UnexpectedEof,
167-
168163
/// Any I/O error not part of this list.
164+
#[stable(feature = "rust1", since = "1.0.0")]
165+
Other,
166+
167+
/// A marker variant that tells the compiler that users of this enum cannot
168+
/// match it exhaustively.
169169
#[unstable(feature = "io_error_internals",
170170
reason = "better expressed through extensible enums that this \
171171
enum cannot be exhaustively matched against",

0 commit comments

Comments
 (0)