From c6984dd51db6be8e260be1494f2bbc9052a42206 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 25 Aug 2023 12:14:01 +0200 Subject: [PATCH] ci: do not tolerate rustc warnings in any job Previously, only the clippy job was denying warnings. We have many other CI jobs that compile our library in all sorts of configurations. All of them should be free of warnings. Pull-Request: #4384. --- .cargo/config.toml | 2 +- .github/workflows/ci.yml | 1 + identity/src/error.rs | 10 +++------- transports/webrtc/src/lib.rs | 1 + 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index e55adcc9ed1..8c1349f4bc0 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,3 @@ [alias] # Temporary solution to have clippy config in a single place until https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md#lintstoml-configuration is shipped. -custom-clippy = "clippy --workspace --all-features --all-targets -- -A clippy::type_complexity -A clippy::pedantic -W clippy::used_underscore_binding -W unreachable_pub -D warnings" +custom-clippy = "clippy --workspace --all-features --all-targets -- -A clippy::type_complexity -A clippy::pedantic -W clippy::used_underscore_binding -W unreachable_pub" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fe3a56f2cd..d5be55d43e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ concurrency: env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 # Fail cache download after 2 minutes. + RUSTFLAGS: '-Dwarnings' # Never tolerate warnings. jobs: test: diff --git a/identity/src/error.rs b/identity/src/error.rs index 4580c4422a1..71cd78fe1ea 100644 --- a/identity/src/error.rs +++ b/identity/src/error.rs @@ -77,11 +77,7 @@ impl DecodingError { } } - #[cfg(any( - all(feature = "rsa", not(target_arch = "wasm32")), - feature = "secp256k1", - feature = "ecdsa" - ))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] pub(crate) fn encoding_unsupported(key_type: &'static str) -> Self { Self { msg: format!("encoding {key_type} key to Protobuf is unsupported"), @@ -111,7 +107,7 @@ pub struct SigningError { /// An error during encoding of key material. impl SigningError { - #[cfg(any(feature = "secp256k1", feature = "rsa"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] pub(crate) fn new(msg: S) -> Self { Self { msg: msg.to_string(), @@ -119,7 +115,7 @@ impl SigningError { } } - #[cfg(feature = "rsa")] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self { Self { source: Some(Box::new(source)), diff --git a/transports/webrtc/src/lib.rs b/transports/webrtc/src/lib.rs index 012796a6b69..f89d946228c 100644 --- a/transports/webrtc/src/lib.rs +++ b/transports/webrtc/src/lib.rs @@ -83,6 +83,7 @@ mod proto { #![allow(unreachable_pub)] include!("generated/mod.rs"); + #[cfg(feature = "tokio")] pub(crate) use self::webrtc::pb::{mod_Message::Flag, Message}; }