From 5c77e5723a79ec709813db6d7c87aee7e86c46ed Mon Sep 17 00:00:00 2001 From: auronandace Date: Sun, 8 Mar 2026 14:50:31 +0000 Subject: [PATCH] mark enum as non-exhaustive --- src/io/error.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/io/error.rs b/src/io/error.rs index 5c5c582eed..f72eb42c24 100644 --- a/src/io/error.rs +++ b/src/io/error.rs @@ -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", } } }