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

Bad suggestion in mistyped literal suffix #4762

Closed
ghost opened this issue Nov 1, 2019 · 0 comments
Closed

Bad suggestion in mistyped literal suffix #4762

ghost opened this issue Nov 1, 2019 · 0 comments
Labels
C-bug Category: Clippy is not doing the correct thing L-suggestion Lint: Improving, adding or fixing lint suggestions

Comments

@ghost
Copy link

ghost commented Nov 1, 2019

The lint literal representation lints get confused when a float has a fraction and an exponent.

In the example below the suggestion includes a weird digit separator after the 'E'.

#[warn(clippy::mistyped_literal_suffix)]

fn main() {
    let _ = 1.12345E1_32;
}
error: mistyped literal suffix
 --> src/main.rs:4:13
  |
4 |     let _ = 1.12345E1_32;
  |             ^^^^^^^^^^^^ help: did you mean to write: `1.123_45E_1_f32`
  |
  = note: `#[deny(clippy::mistyped_literal_suffixes)]` on by default

I'm already working on a fix. I just wanted to document this.

@flip1995 flip1995 added L-suggestion Lint: Improving, adding or fixing lint suggestions C-bug Category: Clippy is not doing the correct thing labels Nov 4, 2019
@flip1995 flip1995 assigned ghost Nov 4, 2019
@bors bors closed this as completed in 2d244d3 Nov 23, 2019
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 L-suggestion Lint: Improving, adding or fixing lint suggestions
Projects
None yet
Development

No branches or pull requests

1 participant