summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openpgp/src/message/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs
index 0839d482..5e1c2fba 100644
--- a/openpgp/src/message/mod.rs
+++ b/openpgp/src/message/mod.rs
@@ -36,12 +36,19 @@ use lalrpop_util::ParseError;
use self::grammar::MessageParser;
/// Errors that MessageValidator::check may return.
+///
+/// Note: This enum cannot be exhaustively matched to allow future
+/// extensions.
#[derive(Debug, Clone)]
pub enum MessageParserError {
/// A parser error.
Parser(ParseError<usize, Token, LexicalError>),
/// An OpenPGP error.
OpenPGP(Error),
+
+ /// This marks this enum as non-exhaustive. Do not use this
+ /// variant.
+ #[doc(hidden)] __Nonexhaustive,
}
impl From<MessageParserError> for failure::Error {
@@ -49,6 +56,7 @@ impl From<MessageParserError> for failure::Error {
match err {
MessageParserError::Parser(p) => p.into(),
MessageParserError::OpenPGP(p) => p.into(),
+ MessageParserError::__Nonexhaustive => unreachable!(),
}
}
}