We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
(-<num> as f64).exp() is linted to -<num>_f64.exp() instead of (-<num>_f64).exp(), which changes its value.
(-<num> as f64).exp()
-<num>_f64.exp()
(-<num>_f64).exp()
I had some f64's set in some tests in the form:
(-8.0 as f64).exp()
When I run cargo clippy --fix, this gets changed to:
cargo clippy --fix
-8.0_f64.exp()
Which should be:
(-8.0_f64).exp()
This also happens for <num> as f32.
<num> as f32
rustc 1.64.0 (a55dd71d5 2022-09-19) binary: rustc commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52 commit-date: 2022-09-19 host: x86_64-unknown-linux-gnu release: 1.64.0 LLVM version: 14.0.6
No response
The text was updated successfully, but these errors were encountered:
@rustbot claim
Sorry, something went wrong.
unnecessary_cast
ac12011
kraktus
Successfully merging a pull request may close this issue.
Summary
(-<num> as f64).exp()
is linted to-<num>_f64.exp()
instead of(-<num>_f64).exp()
, which changes its value.Reproducer
I had some f64's set in some tests in the form:
When I run
cargo clippy --fix
, this gets changed to:Which should be:
This also happens for
<num> as f32
.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: