-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add enum_intrinsics_non_enums lint #83908
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eed91e8
to
19a5830
Compare
While I'm at it, I made the lint also check variant_count |
23dd63f
to
2d6c982
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
aa41738
to
ccfc2b9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bb37d21
to
0160e37
Compare
This comment has been minimized.
This comment has been minimized.
b24d26f
to
ef0c122
Compare
This comment has been minimized.
This comment has been minimized.
ef0c122
to
8764741
Compare
This comment has been minimized.
This comment has been minimized.
16cbeb7
to
1764793
Compare
@Flying-Toast GitHub is still reporting your branch as having conflicts, have you been able to rebase? |
Ping again from triage: |
@JohnCSimon @davidtwco I've rebased the PR, sorry for the delay - I've been busy with school. @flip1995: The patch doesn't apply very well anymore by now - could you make the patch again? |
@Flying-Toast rust-lang/rust follows a "No-Merge Policy". Could you please rebase over upstream changes instead of merging? Thanks! |
This lint has been uplifted and is now included in enum_intrinsics_non_enums.
I updated the gist. This is based on a rebased version of this branch ontop of the current master branch. I also pushed a already rebased version with this patch applied here: https://github.com/flip1995/rust/tree/enum_intrinsics_non_enums You can just force push this to your branch: git remote add flip1995 https://github.com/flip1995/rust --fetch
# The next command assumes, that `origin` is the remote of your fork.
git push origin enum_intrinsics_non_enums:master --force-with-lease |
@flip1995 thanks :) I've pushed from your branch. |
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.
LGTM!
@bors r+ |
📌 Commit f483676 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5b21064): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
There is a clippy lint to prevent calling
mem::discriminant
with a non-enum type. I think the lint is worthy of being included in rustc, given thatdiscriminant::<T>()
whereT
is a non-enum has an unspecified return value, and there are no valid use cases where you'd actually want this.I've also made the lint check variant_count (#73662).
closes #83899