Skip to content

Commit 117cbb8

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35911 - tbu-:pr_io_errorkind_traits, r=alexcrichton
Implement more traits for `std::io::ErrorKind` This makes it possible to use it as key in various maps.
2 parents 4bc5bcd + c2d064e commit 117cbb8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libstd/io/error.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct Custom {
7979
/// It is used with the [`io::Error`] type.
8080
///
8181
/// [`io::Error`]: struct.Error.html
82-
#[derive(Copy, PartialEq, Eq, Clone, Debug)]
82+
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8383
#[stable(feature = "rust1", since = "1.0.0")]
8484
#[allow(deprecated)]
8585
pub enum ErrorKind {
@@ -161,7 +161,8 @@ pub enum ErrorKind {
161161
#[stable(feature = "read_exact", since = "1.6.0")]
162162
UnexpectedEof,
163163

164-
/// Any I/O error not part of this list.
164+
/// A marker variant that tells the compiler that users of this enum cannot
165+
/// match it exhaustively.
165166
#[unstable(feature = "io_error_internals",
166167
reason = "better expressed through extensible enums that this \
167168
enum cannot be exhaustively matched against",

0 commit comments

Comments
 (0)