-
Notifications
You must be signed in to change notification settings - Fork 1.6k
wrong clippy suggestion for div_ceil
in macro definition
#14665
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
Comments
Will take this one |
@rustbot transfer rust-clippy |
github-merge-queue bot
pushed a commit
that referenced
this issue
Apr 27, 2025
here is my small fix changelog: fix suggestion span to avoid showing macro name in `.div_ceil()` suggestion i changed this line `let divisor_snippet = snippet_with_applicability(cx, rhs.spansource_callsite(), "..", applicability);` to this line `let divisor_snippet = snippet_with_applicability(cx, rhs.span, "..", applicability);` to fix problem where this warning in macro expands like this ```rust 4 | let _ = (x + 7) / 8; | ^^^^^^^^^^^ help: consider using `.div_ceil()`: `x.div_ceil(y!())` ``` [play it yourself](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=397aa8cd2ffffb24a286fbddbc75446c) as you can see here it looks like `x.div_ceil(y!())` and contains macro signature so i fixed this problem, i will look closely if there any more problems like this and fix them in order **Related issue** fixes [#14665](#14665)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The source code is here https://github.com/tikv/tikv/blob/7467871cb55b4fe29cee23fa85f0e7fb89768d2b/components/file_system/src/rate_limiter.rs#L266
When I update rust-toolchain from
nightly-2023-12-28
tonightly-2025-04-03
and run cargo clippy, it returnsI expected to see this happen: explanation
Instead, this happened: explanation
Meta
rustc --version --verbose
:The tool chain is
nightly-2025-04-03
Backtrace
The text was updated successfully, but these errors were encountered: