feat(lints): add unsigned_subtraction_gt_zero lint for comparisons against zero after subtraction - #15820
Open
AMS21 wants to merge 1 commit into
Open
feat(lints): add unsigned_subtraction_gt_zero lint for comparisons against zero after subtraction#15820AMS21 wants to merge 1 commit into
unsigned_subtraction_gt_zero lint for comparisons against zero after subtraction#15820AMS21 wants to merge 1 commit into
Conversation
Collaborator
|
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
|
Lintcheck changes for e452f1b
This comment will be updated if you push new changes |
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
3 times, most recently
from
October 7, 2025 08:29
8efc16d to
5effb08
Compare
This comment has been minimized.
This comment has been minimized.
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
October 20, 2025 10:09
5effb08 to
0949f6e
Compare
This comment has been minimized.
This comment has been minimized.
Alexendoo
reviewed
Oct 20, 2025
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
October 20, 2025 19:02
0949f6e to
ed98d29
Compare
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
October 20, 2025 19:43
ed98d29 to
843f706
Compare
This comment has been minimized.
This comment has been minimized.
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
October 30, 2025 09:38
843f706 to
f0b2dae
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
November 30, 2025 10:07
f0b2dae to
12df45f
Compare
This comment has been minimized.
This comment has been minimized.
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
2 times, most recently
from
November 30, 2025 10:15
a395cb2 to
fee9179
Compare
Alexendoo
reviewed
Dec 10, 2025
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
March 2, 2026 14:29
fee9179 to
6716fb2
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
March 5, 2026 16:56
6716fb2 to
6b87db2
Compare
Collaborator
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
…against zero after subtraction
AMS21
force-pushed
the
unsigned_subtraction_gt_zero
branch
from
March 5, 2026 17:37
6b87db2 to
e452f1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
changelog: new lint: [
unsigned_subtraction_gt_zero] Lints comparisons of an unsigned integer subtraction against zero, like(a - b) > 0.If
a < b,a - bwill panic in debug builds and wrap in release builds, making the effectively behave likea != b. This is likely unintended;a > bis clearer and avoids potential panics and wraparound.Fixes #588