Skip to content
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 double comparison lint #2412

Merged
merged 2 commits into from
Jan 30, 2018
Merged

Conversation

topecongiro
Copy link
Contributor

@topecongiro topecongiro commented Jan 30, 2018

cc #753.
Closes #2411.

(And rustup to rustc 1.25.0-nightly (90eb44a58 2018-01-29 😞)

if x >= y && x <= y {
// do something
}
}
Copy link
Member

@matthiaskrgr matthiaskrgr Jan 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: nevermind there is already a warning about that :)

hm, what about

if x == y && x != y {}
if x == y || x != y {}

(or is that already warned about?)

@oli-obk
Copy link
Contributor

oli-obk commented Jan 30, 2018

Thanks! I added a comment to the issue for further possible lints in this direction

@oli-obk oli-obk merged commit dbbae57 into rust-lang:master Jan 30, 2018
@topecongiro topecongiro deleted the double-comparison branch January 30, 2018 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants