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

Change in code behavior/values from linting (-8.0 as f64).exp() -> -8.0_f64.exp() #9563

Closed
eblocha opened this issue Oct 1, 2022 · 1 comment · Fixed by #9577
Closed
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@eblocha
Copy link

eblocha commented Oct 1, 2022

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:

(-8.0 as f64).exp()

When I run cargo clippy --fix, this gets changed to:

-8.0_f64.exp()

Which should be:

(-8.0_f64).exp()

This also happens for <num> as f32.

Version

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

Additional Labels

No response

@eblocha eblocha added the C-bug Category: Clippy is not doing the correct thing label Oct 1, 2022
@kraktus
Copy link
Contributor

kraktus commented Oct 2, 2022

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants