-
Notifications
You must be signed in to change notification settings - Fork 910
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
Unexpected arrow indent change in trait methods with Rust edition 2024 #6482
Comments
What version of rustfmt are you using? When I build and run rustfmt from source (version: rustfmt 1.8.0-nightly (5619b64 2025-02-12)), I get the same output for all edition values. So I'd say this is expected. running trait Foo {
fn fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(_: ())
-> u32;
} |
@ytmimi: rustfmt 1.8.0-stable (4d91de4e48 2025-02-17) which is provided by Rust 1.85 stable toolchain. You can reproduce the result using the playground link I provided above by selecting different editions and run the Rustfmt tool. |
I realize now that setting |
Based on the Style Guild section for function definitions this formatting doesn't seem correct to me. I'd expect something like this: trait Foo {
fn fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(
_: ()
) -> u32;
} |
With the following code:
The
->
is indented with 4 spaces afterfn
with edition 2021, but with edition 2024, rustfmt will align->
withfn
:Here is a playground link for this: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9cb2cfab404be994870455658edba6e0.
Is this change intended?
The text was updated successfully, but these errors were encountered: