-
Notifications
You must be signed in to change notification settings - Fork 1
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
Disallow bitwise negation inside boolean context #46
Labels
A-user-story
Area: A user story or a related issue
Comments
Marker should already be capable to create such a lint. I would suggest waiting until v0.3.0, which will be released at the start of next month, since there will be several breaking changes in that one. Then we could implement this. :D I feel like this could also be a good lint for Clippy, as it seems to be generally applicable. It surprised me that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lint explanation
Bitwise negation might lead to hard-to-spot errors in case it is confused with a boolean negation.
Example code
Note that the code above is wrong and the intended code is
Notes
While this lint is very specific to
if
scenario above, we would be happy with a simple "no bitwise negation" lint as our codebase does not contain much of bit-twiddling.The text was updated successfully, but these errors were encountered: