Skip to content

Array types are formatted in non-standard way in type hints #2921

@jplatte

Description

@jplatte

Thanks for ra! I quickly noticed a very minor thing when trying it out: With this code

let x = [0.0; 3];

I get a type hint like this:

let x: [f64;_] = [0.0; 3];

This is not how rustfmt would format this if there was a type annotation (actually, _ is not valid in that position, but this is true when using 3 instead in this example). It would add a space after the semicolon:

let x: [f64; _] = [0.0; 3];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions