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 formatting for nested tuple field accesses on style_edition < 2024 when the accesses are formatted on different lines. #6433

Open
WaffleLapkin opened this issue Jan 2, 2025 · 1 comment
Labels
a-2015-edition Style Edition 2015 - 2021 poor-formatting

Comments

@WaffleLapkin
Copy link
Member

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).

@ytmimi
Copy link
Contributor

ytmimi commented Jan 2, 2025

style_edition < 2024 is currently stable, so I don't think there's much we can do to change the formatting. Maybe we could treat this as a bug fix? @calebcartwright what are your thoughts?

@ytmimi ytmimi added a-2015-edition Style Edition 2015 - 2021 poor-formatting labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-2015-edition Style Edition 2015 - 2021 poor-formatting
Projects
None yet
Development

No branches or pull requests

2 participants