Merge branch 'non-exhaustive-enum' into 'master'

mark enum as non-exhaustive

See merge request redox-os/relibc!1071
This commit is contained in:
Jeremy Soller
2026-03-08 09:15:27 -06:00
+1 -6
View File
@@ -220,6 +220,7 @@ struct Custom {
/// [`io::Error`]: struct.Error.html
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[allow(deprecated)]
#[non_exhaustive]
pub enum ErrorKind {
/// An entity was not found, often a file.
NotFound,
@@ -285,11 +286,6 @@ pub enum ErrorKind {
/// particular number of bytes but only a smaller number of bytes could be
/// read.
UnexpectedEof,
/// A marker variant that tells the compiler that users of this enum cannot
/// match it exhaustively.
#[doc(hidden)]
__Nonexhaustive,
}
impl ErrorKind {
@@ -313,7 +309,6 @@ impl ErrorKind {
ErrorKind::Interrupted => "operation interrupted",
ErrorKind::Other => "other os error",
ErrorKind::UnexpectedEof => "unexpected end of file",
_ => "unknown error",
}
}
}