From dcf6af405d41b6b249e9a736e1bd086fa832af65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 27 Nov 2024 12:17:23 +0100 Subject: [PATCH] chore: Silence unexpected cfg warnings These are all coming from macro invocations of macros that are defined in other crates. It's likely a clippy issue. We should try to revert this the next time we bump the nightly version we're using. --- bindings/matrix-sdk-ffi/src/lib.rs | 2 ++ crates/matrix-sdk-base/src/lib.rs | 1 + crates/matrix-sdk-base/src/rooms/mod.rs | 3 ++- crates/matrix-sdk-crypto/src/lib.rs | 1 + crates/matrix-sdk-sqlite/src/lib.rs | 1 + crates/matrix-sdk-ui/src/lib.rs | 2 ++ crates/matrix-sdk-ui/tests/integration/main.rs | 2 ++ crates/matrix-sdk/src/lib.rs | 1 + crates/matrix-sdk/tests/integration/main.rs | 2 +- examples/custom_events/src/main.rs | 2 ++ testing/matrix-sdk-integration-testing/src/lib.rs | 1 + 11 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/lib.rs b/bindings/matrix-sdk-ffi/src/lib.rs index a648947c2..f4a937967 100644 --- a/bindings/matrix-sdk-ffi/src/lib.rs +++ b/bindings/matrix-sdk-ffi/src/lib.rs @@ -1,6 +1,8 @@ // TODO: target-os conditional would be good. #![allow(unused_qualifications, clippy::new_without_default)] +#![allow(clippy::empty_line_after_doc_comments)] // Needed because uniffi macros contain empty + // lines after docs. mod authentication; mod chunk_iterator; diff --git a/crates/matrix-sdk-base/src/lib.rs b/crates/matrix-sdk-base/src/lib.rs index 0c4f394fd..aacbc1b20 100644 --- a/crates/matrix-sdk-base/src/lib.rs +++ b/crates/matrix-sdk-base/src/lib.rs @@ -16,6 +16,7 @@ #![doc = include_str!("../README.md")] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(target_arch = "wasm32", allow(clippy::arc_with_non_send_sync))] +#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation. #![warn(missing_docs, missing_debug_implementations)] pub use matrix_sdk_common::*; diff --git a/crates/matrix-sdk-base/src/rooms/mod.rs b/crates/matrix-sdk-base/src/rooms/mod.rs index cd884e9c8..9d63e6a84 100644 --- a/crates/matrix-sdk-base/src/rooms/mod.rs +++ b/crates/matrix-sdk-base/src/rooms/mod.rs @@ -1,4 +1,5 @@ -#![allow(clippy::assign_op_pattern)] // triggered by bitflags! usage +#![allow(clippy::assign_op_pattern)] // Triggered by bitflags! usage +#![allow(unexpected_cfgs)] // Triggered by the `EventContent` macro usage mod members; pub(crate) mod normal; diff --git a/crates/matrix-sdk-crypto/src/lib.rs b/crates/matrix-sdk-crypto/src/lib.rs index 0f0b109e9..0da301178 100644 --- a/crates/matrix-sdk-crypto/src/lib.rs +++ b/crates/matrix-sdk-crypto/src/lib.rs @@ -17,6 +17,7 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn(missing_docs, missing_debug_implementations)] #![cfg_attr(target_arch = "wasm32", allow(clippy::arc_with_non_send_sync))] +#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation. pub mod backups; mod ciphers; diff --git a/crates/matrix-sdk-sqlite/src/lib.rs b/crates/matrix-sdk-sqlite/src/lib.rs index ff62c3f7f..8da15149c 100644 --- a/crates/matrix-sdk-sqlite/src/lib.rs +++ b/crates/matrix-sdk-sqlite/src/lib.rs @@ -15,6 +15,7 @@ not(any(feature = "state-store", feature = "crypto-store", feature = "event-cache")), allow(dead_code, unused_imports) )] +#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation. #[cfg(feature = "crypto-store")] mod crypto_store; diff --git a/crates/matrix-sdk-ui/src/lib.rs b/crates/matrix-sdk-ui/src/lib.rs index b0f07b9c6..cfb06210c 100644 --- a/crates/matrix-sdk-ui/src/lib.rs +++ b/crates/matrix-sdk-ui/src/lib.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation. + use ruma::html::HtmlSanitizerMode; mod events; diff --git a/crates/matrix-sdk-ui/tests/integration/main.rs b/crates/matrix-sdk-ui/tests/integration/main.rs index da8bc38c3..1a9d9ac82 100644 --- a/crates/matrix-sdk-ui/tests/integration/main.rs +++ b/crates/matrix-sdk-ui/tests/integration/main.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![allow(unexpected_cfgs)] // Triggered by the init_tracing_for_tests!() invocation. + use itertools::Itertools as _; use matrix_sdk::deserialized_responses::TimelineEvent; use ruma::{events::AnyStateEvent, serde::Raw, EventId, RoomId}; diff --git a/crates/matrix-sdk/src/lib.rs b/crates/matrix-sdk/src/lib.rs index 0c7864d3a..437f750d3 100644 --- a/crates/matrix-sdk/src/lib.rs +++ b/crates/matrix-sdk/src/lib.rs @@ -17,6 +17,7 @@ #![warn(missing_debug_implementations, missing_docs)] #![cfg_attr(target_arch = "wasm32", allow(clippy::arc_with_non_send_sync))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation. pub use async_trait::async_trait; pub use bytes; diff --git a/crates/matrix-sdk/tests/integration/main.rs b/crates/matrix-sdk/tests/integration/main.rs index 10205a560..7dc0170e6 100644 --- a/crates/matrix-sdk/tests/integration/main.rs +++ b/crates/matrix-sdk/tests/integration/main.rs @@ -1,6 +1,6 @@ // The http mocking library is not supported for wasm32 #![cfg(not(target_arch = "wasm32"))] - +#![allow(unexpected_cfgs)] // Triggered by the init_tracing_for_tests!() invocation. use matrix_sdk::{config::SyncSettings, test_utils::logged_in_client_with_server, Client}; use matrix_sdk_test::test_json; use serde::Serialize; diff --git a/examples/custom_events/src/main.rs b/examples/custom_events/src/main.rs index d88dc5ffa..c2c54a769 100644 --- a/examples/custom_events/src/main.rs +++ b/examples/custom_events/src/main.rs @@ -1,3 +1,5 @@ +#![allow(unexpected_cfgs)] // Triggered by the `EventContent` macro usage + /// /// This is an example showcasing how to build a very simple bot with custom /// events using the matrix-sdk. To try it, you need a rust build setup, then diff --git a/testing/matrix-sdk-integration-testing/src/lib.rs b/testing/matrix-sdk-integration-testing/src/lib.rs index eeeeb1123..ade85ecac 100644 --- a/testing/matrix-sdk-integration-testing/src/lib.rs +++ b/testing/matrix-sdk-integration-testing/src/lib.rs @@ -1,4 +1,5 @@ #![cfg(test)] +#![allow(unexpected_cfgs)] // Triggered by the init_tracing_for_tests!() invocation. matrix_sdk_test::init_tracing_for_tests!();