Skip to content

Commit

Permalink
Fix clippy::empty_enum triggering on nightly with `feature(never_ty…
Browse files Browse the repository at this point in the history
…pe)` enabled (#234)
  • Loading branch information
Veetaha authored Dec 23, 2024
1 parent 7a4b211 commit 34cb745
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bon-macros/src/builder/builder_gen/state_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
)*
}
}
Expand Down
3 changes: 3 additions & 0 deletions bon/tests/integration/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 34cb745

Please sign in to comment.