Skip to content

Bad formatting for nested tuple field accesses on style_edition < 2024 when the accesses are formatted on different lines. #6433

Open
@WaffleLapkin

Description

@WaffleLapkin

The following is output of rustfmt:

fn f() {
    x.f()
        .0
         .0
        .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();
}

Note that the second .0 is offset by a single space. I know that this is because of compatibility with old rustc versions that lexed .0.0 as a float (i.e. #4355 (comment)).

However, in this case, the additional space is not needed -- they are on different lines (and in fact have multiple spaces just because of the indentation).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions