Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy::empty_enum triggering on nightly with feature(never_type) enabled #234

Merged
merged 5 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading