From 079379a1785255332b228af68e6025f29999c64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sun, 16 Jun 2024 10:45:09 +0200 Subject: [PATCH] Fix build with nightly rust Nightly rust complains about `cfg(..)` tests against undeclared features and other unknown cfgs. They need to be explicitly declared now. The nightly/stable features don't exist, so I removed them and substitutes the currently correct number for the single test where they were used. The `xmpprs_doc_build` cfg flag is now declared as expectable. --- parsers/src/jingle.rs | 6 +----- tokio-xmpp/Cargo.toml | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/parsers/src/jingle.rs b/parsers/src/jingle.rs index a116cc79..b560e74c 100644 --- a/parsers/src/jingle.rs +++ b/parsers/src/jingle.rs @@ -703,11 +703,7 @@ mod tests { assert_size!(Senders, 1); assert_size!(Disposition, 1); assert_size!(ContentId, 24); - // TODO: Remove conditional - #[cfg(feature = "nightly")] - assert_size!(Content, 448); - #[cfg(feature = "stable")] - assert_size!(Content, 440); + assert_size!(Content, 432); assert_size!(Reason, 1); assert_size!(ReasonElement, 32); assert_size!(SessionId, 24); diff --git a/tokio-xmpp/Cargo.toml b/tokio-xmpp/Cargo.toml index 223356ed..0c2c688a 100644 --- a/tokio-xmpp/Cargo.toml +++ b/tokio-xmpp/Cargo.toml @@ -50,3 +50,6 @@ insecure-tcp = [] syntax-highlighting = ["syntect"] # Enable serde support in jid crate serde = [ "xmpp-parsers/serde" ] + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(xmpprs_doc_build)'] }