Skip to content

Fix false positives in duration_suboptimal_units for small literals#16565

Closed
Hectonight wants to merge 3 commits into
rust-lang:masterfrom
Hectonight:duration-suboptimal-units-literals
Closed

Fix false positives in duration_suboptimal_units for small literals#16565
Hectonight wants to merge 3 commits into
rust-lang:masterfrom
Hectonight:duration-suboptimal-units-literals

Conversation

@Hectonight

@Hectonight Hectonight commented Feb 14, 2026

Copy link
Copy Markdown

fixes #16532

changelog: Fix [duration_suboptimal_units] false positive for small integer literals (at most 10).

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 14, 2026
@rustbot

rustbot commented Feb 14, 2026

Copy link
Copy Markdown
Collaborator

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

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

@rustbot

rustbot commented Feb 22, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly 739f462) made this pull request unmergeable. Please resolve the merge conflicts.

@ada4a ada4a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Apparently there was another PR which addressed the same issue: #16596; I personally like its descriptive comments, because they explain not only the what, but also the why -- could you please port them to your PR? Though maybe it would make sense to put them into the lint description, so that they are more easily accessible to the end users, and in the comment above the check itself, just refer the reader to the description.

View changes since this review

@tanndlin

Copy link
Copy Markdown
Contributor

This PR looks extremely close but forgotten. How can I help get this across the finish line?

@ada4a

ada4a commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Hello @tanndlin, thank you for your interest:) I think your best bet would be to open a copy of this PR, fix the merge conflicts, and add the comments I've proposed in the comment above; then we can review it:)

@tanndlin

Copy link
Copy Markdown
Contributor

I have made a PR that combines the code from this one and the comments from #16596

#16922

ada4a added a commit to ada4a/rust-clippy that referenced this pull request May 15, 2026
*[View all
comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust-clippy/pull/16922)*

fixes rust-lang#16532

changelog: [`duration_suboptimal_units`]: fix false positive for small
integer literals whose promoted value would be at most 10.

Combined rust-lang#16565 and rust-lang#16596
@ada4a ada4a closed this May 16, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 16, 2026
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.

duration_suboptimal_units should not trigger on small values

5 participants