-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Disable empty_enum
lint on stable (or change recommendation)
#6422
Comments
Has anyone worked on this? If not, I'd be happy to jump on it. @flip1995 Might need a few hints :) |
@nahuakang You can check with rust-clippy/clippy_lints/src/unnested_or_patterns.rs Lines 75 to 78 in abce9e7
if a specific feature is enabled. This lint should only trigger if the |
…p1995 Fix: Empty enum never type suggested only if the feature is enabled This PR addresses [Issue 6422](#6422). Instead of always recommending `never type` for empty enums, Clippy would only recommend [the lint](https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum) if [LatePass.TyCtxt](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html) has `features().never_type` enabled. - \[ ] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog:
…p1995 Fix: Empty enum never type suggested only if the feature is enabled This PR addresses [Issue 6422](#6422). Instead of always recommending `never type` for empty enums, Clippy would only recommend [the lint](https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum) if [LatePass.TyCtxt](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html) has `features().never_type` enabled. - \[ ] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: Only trigger [`empty_enum`] lint if `never_type` feature is enabled.
Hey, what is the status on this issue? It seems like #6513 implemented this. Can this one be closed or is there still something left to do? 🙃 |
Hey Fred! @flip1995 can correct me if wrong, but I think the issue is fixed now :) |
Currently the
empty_enum
lint recommends using the seemingly forever-unstable never type. While the never type may have better compiler support in some aspects, the suggested change to use a wrapper type around!
obviously isn't possible on stable.I'm not sure whether clippy currently has the ability to have nightly-only lints, but it's what makes sense here imo.
The text was updated successfully, but these errors were encountered: