-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add lint for calling mem::discriminant on a non-enum type
#3346
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
Conversation
25bcf2b to
06e3bee
Compare
|
not sure what happened here https://travis-ci.org/rust-lang-nursery/rust-clippy/jobs/444259747 |
Timeout, happens sometimes. I restarted it |
flip1995
left a comment
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.
Applicability level of this lint is missing.
Could you add a test for calling this function inside of a macro? Most of the time macros result in weird suggestions/behavior.
bc16b2c to
40239ce
Compare
ed2d1f0 to
d53e6f8
Compare
|
Thanks! bors r+ |
3346: Add lint for calling `mem::discriminant` on a non-enum type r=flip1995 a=HMPerson1 Also, if the type is a reference to an enum, we suggest removing `&`s and/or dereferencing. Fixes #3342 Co-authored-by: HMPerson1 <[email protected]> Co-authored-by: Philipp Krones <[email protected]>
Also, if the type is a reference to an enum, we suggest removing
&s and/or dereferencing.Fixes #3342