Skip to content

Conversation

@ianbollinger
Copy link

@ianbollinger ianbollinger commented Nov 5, 2025

This change expands the double_comparisons lint to check for expressions of the form x != y && x >= y and x != y && x <= y. Since the lint already checks for their dual (x == y || x < y and x == y || x > y, respectively) while also checking for x <= y && x >= y and its dual x > y || x < y, it seemed like these two new cases were, in some sense, missing.

Issues #685 and #753 appear pertinent here.

changelog: [double_comparisons] check and offer suggestions for expressions such as x != y && x >= y

Add checks for expressions such as `x != y && x >= y` and `x != y && x <= y`.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 5, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Contributor

@ada4a ada4a left a comment

Choose a reason for hiding this comment

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

Makes a lot of sense:)

(not an actual reviewer)

View changes since this review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants