Skip to content

Conversation

@mnemonikr
Copy link
Contributor

@mnemonikr mnemonikr commented Dec 12, 2025

Suggest using x.div_ceil(y) instead of x.next_multiple_of(y) / y.

fixes #16219

changelog: [manual_div_ceil]: Added check for variant x.next_multiple_of(y) / y

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2025

r? @Jarcho

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

@mnemonikr
Copy link
Contributor Author

mnemonikr commented Dec 12, 2025

While this catches x.next_multiple_of(y) / y, it currently doesn't catch the same call if formatted as u32::next_multiple_of(x, y) / y. Happy to accept pointers on what changes I'd need to make to cover this edge case as well.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Dec 13, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 13, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@mnemonikr mnemonikr force-pushed the issue-16219 branch 2 times, most recently from fb09156 to 5c1ffda Compare December 13, 2025 17:57
@mnemonikr
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Dec 13, 2025
@mnemonikr mnemonikr requested a review from Jarcho December 15, 2025 18:31
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Dec 24, 2025
@mnemonikr
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Dec 31, 2025
Copy link
Contributor

@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

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

@Jarcho Jarcho added this pull request to the merge queue Jan 1, 2026
Merged via the queue into rust-lang:master with commit 5a97a17 Jan 1, 2026
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 1, 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.

manual_div_ceil should warn on manual implementations using next_multiple_of

3 participants