-
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
Fix: Empty enum never type suggested only if the feature is enabled #6513
Fix: Empty enum never type suggested only if the feature is enabled #6513
Conversation
r? @Manishearth (rust-highfive has picked a reviewer for you, use r? to override) |
r? @flip1995 After our discussion via email, I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just some NITS and a test missing.
@flip1995 Made changes according to your feedback. Thanks so much 🙏 |
@bors r+ Thanks! |
📌 Commit a8d47b4 has been approved by |
…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:
💔 Test failed - checks-action_test |
@bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR addresses Issue 6422. Instead of always recommending
never type
for empty enums, Clippy would only recommend the lint if LatePass.TyCtxt hasfeatures().never_type
enabled..stderr
file)cargo test
passes locallycargo dev update_lints
cargo dev fmt
Please write a short comment explaining your change (or "none" for internal only changes)
changelog: Only trigger [
empty_enum
] lint ifnever_type
feature is enabled.