Make std::io::Error #[non_exhaustive]
This commit is contained in:
parent
a50224804d
commit
ea505fd60b
2 changed files with 2 additions and 10 deletions
|
@ -97,6 +97,7 @@ struct Custom {
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum ErrorKind {
|
pub enum ErrorKind {
|
||||||
/// An entity was not found, often a file.
|
/// An entity was not found, often a file.
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
@ -180,15 +181,6 @@ pub enum ErrorKind {
|
||||||
/// read.
|
/// read.
|
||||||
#[stable(feature = "read_exact", since = "1.6.0")]
|
#[stable(feature = "read_exact", since = "1.6.0")]
|
||||||
UnexpectedEof,
|
UnexpectedEof,
|
||||||
|
|
||||||
/// 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",
|
|
||||||
issue = "0")]
|
|
||||||
#[doc(hidden)]
|
|
||||||
__Nonexhaustive,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ErrorKind {
|
impl ErrorKind {
|
||||||
|
@ -212,7 +204,6 @@ impl ErrorKind {
|
||||||
ErrorKind::Interrupted => "operation interrupted",
|
ErrorKind::Interrupted => "operation interrupted",
|
||||||
ErrorKind::Other => "other os error",
|
ErrorKind::Other => "other os error",
|
||||||
ErrorKind::UnexpectedEof => "unexpected end of file",
|
ErrorKind::UnexpectedEof => "unexpected end of file",
|
||||||
ErrorKind::__Nonexhaustive => unreachable!()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,6 +311,7 @@
|
||||||
#![feature(doc_keyword)]
|
#![feature(doc_keyword)]
|
||||||
#![feature(panic_info_message)]
|
#![feature(panic_info_message)]
|
||||||
#![feature(panic_implementation)]
|
#![feature(panic_implementation)]
|
||||||
|
#![feature(non_exhaustive)]
|
||||||
|
|
||||||
#![default_lib_allocator]
|
#![default_lib_allocator]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue