diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5d625ae140..1f8568549f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -181,14 +181,12 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: check --feature-powerset - run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --skip ffi,tracing - env: - RUSTFLAGS: "-D dead_code -D unused_imports" + run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --features __deny_warnings --skip ffi,tracing - name: check --feature-powerset with tracing feature - run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --features tracing --skip ffi + run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --features tracing,__deny_warnings --skip ffi env: - RUSTFLAGS: "--cfg hyper_unstable_tracing -D dead_code -D unused_imports" + RUSTFLAGS: "--cfg hyper_unstable_tracing" ffi: name: Test C API (FFI) diff --git a/Cargo.toml b/Cargo.toml index 7f372a27ed..947e34c04f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,6 +96,7 @@ capi = [] tracing = ["dep:tracing"] # internal features used in CI +__deny_warnings = [] nightly = [] [lints.rust.unexpected_cfgs] diff --git a/src/lib.rs b/src/lib.rs index 8d6e2d2d5a..c7894a608a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,10 @@ #![deny(missing_docs)] #![deny(missing_debug_implementations)] #![cfg_attr(test, deny(rust_2018_idioms))] -#![cfg_attr(all(test, feature = "full"), deny(unreachable_pub))] -#![cfg_attr(all(test, feature = "full"), deny(warnings))] +#![cfg_attr( + any(all(test, feature = "full"), feature = "__deny_warnings"), + deny(warnings, unreachable_pub) +)] #![cfg_attr(all(test, feature = "nightly"), feature(test))] #![cfg_attr(docsrs, feature(doc_cfg))]