summaryrefslogtreecommitdiffstats
path: root/openpgp/src/message
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-03-28 13:49:00 +0200
committerJustus Winter <justus@sequoia-pgp.org>2022-03-28 13:49:00 +0200
commitf66d98e0fac7320af3e918bbb69f09b130df3d63 (patch)
tree9390d1ff70f13bafcdfeec7e2646085c138ebe85 /openpgp/src/message
parent407141a8e798d5799b16b2d5310a06c0aae38244 (diff)
openpgp: Clarify that message::Token is not covered by SemVer.
- Do this using a deprecation so that anyone using it will get a compiler warning. - Revert this change once message::Token is private. - See #836.
Diffstat (limited to 'openpgp/src/message')
-rw-r--r--openpgp/src/message/lexer.rs2
-rw-r--r--openpgp/src/message/mod.rs5
2 files changed, 6 insertions, 1 deletions
diff --git a/openpgp/src/message/lexer.rs b/openpgp/src/message/lexer.rs
index 8e6f8910..e32f58ed 100644
--- a/openpgp/src/message/lexer.rs
+++ b/openpgp/src/message/lexer.rs
@@ -13,6 +13,8 @@ pub(crate) type LexerItem<Tok, Loc, Error>
/// extensions.
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq)]
+#[deprecated(since = "1.9.0",
+ note = "Not covered by SemVer guarantees, DO NOT match on it.")]
pub enum Token {
/// A Literal data packet.
Literal,
diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs
index 0967607e..9e734aa4 100644
--- a/openpgp/src/message/mod.rs
+++ b/openpgp/src/message/mod.rs
@@ -21,6 +21,9 @@
//!
//! [Section 11.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-11.3
+// XXX: For Token. Drop this once Token is private.
+#![allow(deprecated)]
+
use std::convert::TryFrom;
use std::fmt;
use std::io;
@@ -35,7 +38,7 @@ use crate::packet::Tag;
use crate::parse::Parse;
mod lexer;
-lalrpop_util::lalrpop_mod!(#[allow(clippy::all)] grammar, "/message/grammar.rs");
+lalrpop_util::lalrpop_mod!(#[allow(clippy::all, deprecated)] grammar, "/message/grammar.rs");
use self::lexer::{Lexer, LexicalError};
pub use self::lexer::Token;