-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Consider warning by default for foo == bar;
statements
#38224
Comments
I think this is a good candidate for an on-by-default builtin lint:
|
We could also show a note/hint to use the more explicit |
Needs RFC. |
Closing in favor of rust-lang/rfcs#1812. |
One can make a mistake where they mistype
=
to==
.Consider the following code:
No warning is produced for this code.
I'd argue that this is a common enough mistake to justify warning by default for it.
If the user explicitly wants to do this operation for side effects or whatever, they can do
let _ = a == b;
, similarly to the explicit version for#[must_use]
types.The text was updated successfully, but these errors were encountered: