Skip to content

feat: detect == 0 on unsigned types as a manual_clamp lower bound#16800

Open
LesnyRumcajs wants to merge 1 commit intorust-lang:masterfrom
LesnyRumcajs:master
Open

feat: detect == 0 on unsigned types as a manual_clamp lower bound#16800
LesnyRumcajs wants to merge 1 commit intorust-lang:masterfrom
LesnyRumcajs:master

Conversation

@LesnyRumcajs
Copy link
Copy Markdown

Closes #16792

For unsigned types, if x == 0 can be expressed as if x < 1. The former was not caught by manual_clamp lint; this PR normalizes it so that cases as described in the linked issue are caught.

changelog: manual_clamp detect == 0 on unsigned types as a clamp lower bound

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 3, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 3, 2026

r? @dswij

rustbot has assigned @dswij.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 7 candidates
  • 7 candidates expanded to 7 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

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.

manual_clamp improvement for unsigned types

3 participants