Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest manual_div_ceil even when right operand is a constant #13951

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

samueltardieu
Copy link
Contributor

@samueltardieu samueltardieu commented Jan 6, 2025

changelog: [manual_div_ceil]: lint constants as well

Fix #13950

@rustbot
Copy link
Collaborator

rustbot commented Jan 6, 2025

r? @blyxyas

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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 6, 2025
@samueltardieu
Copy link
Contributor Author

I opened a thread on Zulip to discuss how to handle (x + 1) / 2 which might not semantically be a div_ceil() operation, as the user might want to compute a midpoint here.

Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

Great contribution! Just a nit about documentation.

clippy_lints/src/manual_div_ceil.rs Show resolved Hide resolved
@samueltardieu samueltardieu force-pushed the push-msupyrtpkvut branch 2 times, most recently from 98ff2e3 to 79302da Compare January 13, 2025 18:27
Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! ❤️

@blyxyas blyxyas added this pull request to the merge queue Jan 14, 2025
Merged via the queue into rust-lang:master with commit 7e83ec5 Jan 14, 2025
11 checks passed
@samueltardieu samueltardieu deleted the push-msupyrtpkvut branch January 14, 2025 22:58
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 does not check constants
3 participants