Skip to content

Conversation

@mnemonikr
Copy link

@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
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
Copy link
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
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_div_ceil should warn on manual implementations using next_multiple_of

3 participants