Skip to content

Bad suggestion in mistyped literal suffix #4762

Closed
@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingL-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions