diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 575ca7b4..f4c5d5b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,6 +166,10 @@ jobs: --allow edition-2024-expr-fragment-specifier \ --allow if_let_rescope \ --allow impl-trait-overcaptures + env: + RUSTFLAGS: >- + --deny warnings + --cfg ${{ matrix.toolchain }} cargo-miri: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index ed864851..4be6a7c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,6 +148,8 @@ missing_crate_level_docs = "warn" unescaped_backticks = "warn" [workspace.lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(nightly)'] } + # This lint is used only to warn about the changes in drop order during the # transition from Rust 2021 to Rust 2024. There are too many instances of this # lint in our code base and some of them may be false positives. So we just allow diff --git a/bon-macros/src/builder/builder_gen/state_mod.rs b/bon-macros/src/builder/builder_gen/state_mod.rs index 9185d740..7f22ac65 100644 --- a/bon-macros/src/builder/builder_gen/state_mod.rs +++ b/bon-macros/src/builder/builder_gen/state_mod.rs @@ -271,7 +271,7 @@ impl<'a> StateModGenCtx<'a> { #[allow(non_camel_case_types)] mod members { #( - #vis_child_child enum #stateful_members_snake {} + #vis_child_child struct #stateful_members_snake(()); )* } } diff --git a/bon/tests/integration/main.rs b/bon/tests/integration/main.rs index 276f0a06..3d8cbf13 100644 --- a/bon/tests/integration/main.rs +++ b/bon/tests/integration/main.rs @@ -10,6 +10,9 @@ missing_docs, impl_trait_overcaptures, )] +// This catches the problem of `clippy::empty_enum` lint triggering. +// This lint is enabled only when `feature(never_type)` is enabled. +#![cfg_attr(nightly, allow(unstable_features), feature(never_type))] #[cfg(feature = "alloc")] extern crate alloc;