Skip to content

Commit 34cb745

Browse files
authored
Fix clippy::empty_enum triggering on nightly with feature(never_type) enabled (#234)
1 parent 7a4b211 commit 34cb745

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ jobs:
166166
--allow edition-2024-expr-fragment-specifier \
167167
--allow if_let_rescope \
168168
--allow impl-trait-overcaptures
169+
env:
170+
RUSTFLAGS: >-
171+
--deny warnings
172+
--cfg ${{ matrix.toolchain }}
169173
170174
cargo-miri:
171175
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ missing_crate_level_docs = "warn"
148148
unescaped_backticks = "warn"
149149

150150
[workspace.lints.rust]
151+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(nightly)'] }
152+
151153
# This lint is used only to warn about the changes in drop order during the
152154
# transition from Rust 2021 to Rust 2024. There are too many instances of this
153155
# lint in our code base and some of them may be false positives. So we just allow

bon-macros/src/builder/builder_gen/state_mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl<'a> StateModGenCtx<'a> {
271271
#[allow(non_camel_case_types)]
272272
mod members {
273273
#(
274-
#vis_child_child enum #stateful_members_snake {}
274+
#vis_child_child struct #stateful_members_snake(());
275275
)*
276276
}
277277
}

bon/tests/integration/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
missing_docs,
1111
impl_trait_overcaptures,
1212
)]
13+
// This catches the problem of `clippy::empty_enum` lint triggering.
14+
// This lint is enabled only when `feature(never_type)` is enabled.
15+
#![cfg_attr(nightly, allow(unstable_features), feature(never_type))]
1316

1417
#[cfg(feature = "alloc")]
1518
extern crate alloc;

0 commit comments

Comments
 (0)