-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
BUG: Incorrect mistyped literal suffix on long floats. #4706
Comments
Reduced: const A: f64 = 0.0_32; this is because of rust-clippy/clippy_lints/src/literal_representation.rs Lines 581 to 583 in 1d0f625
|
I think we shouldn't check for possibly mistyped suffixes in the digits in the fractional part of a literal. |
I have some ideas on simplifying the mistyped literal code. If it works out, I'll fix this next. @rustbot claim |
Just a thought as the user- the thing that surprised me was the cycle: i.e. one fix suggestion triggered another error. Is it feasible / desirable to catch this by running the suggested fix itself back through clippy? |
We do this, if applicable. No idea, why we don't do this here. Probably it's just that we forgot to add a test case for this. |
Do not lint float fractions in `mistyped_literal_suffixes` As suggested in #4706 (comment), the fractional part is now ignored (the integer part is checked instead). Fixes: #4706 changelog: `mistyped_literal_suffixes` no longer warns on the fractional part of a float (e.g. 713.23_64)
Do not lint float fractions in `mistyped_literal_suffixes` As suggested in #4706 (comment), the fractional part is now ignored (the integer part is checked instead). Fixes: #4706 changelog: `mistyped_literal_suffixes` no longer warns on the fractional part of a float (e.g. 713.23_64)
I have a long literal float, which clippy warns that it lacks literal separators:
But after fixing it, clippy gives an error saying
mistyped literal suffix
Related to: #3091
The text was updated successfully, but these errors were encountered: