You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to rust-lang/rustfmt#5892. To summarize, there are inconsistencies when formatting Type Alias Bounds with rustfmt when using different style_edition values.
Using style_edition={2015|2018|2021} produces the following output:
So I'm wondering what the correct formatting should be, and if the Style Guide should be updated to provide clearer guidance on this.
Another question I have is how should Type Alias Bounds be formatted in this following case:
// This is the formatting rustfmt produces for all style editionstypeAAAAAAAAAAAAA:BBBBBBBBBBBBBBB<CCCCCCCCCCCCCCCCC,DDDDDDDDDDDDDDDDD,EEEEEEEEEEEEEEEEE,FFFFFFFFFFFFFFFFF,GGGGGGGGGGGGGGGGG,HHHHHHHHHHHHHHHHH,IIIIIIIIIIIIIIIII,> + Copy
+ Debug;
The text was updated successfully, but these errors were encountered:
can be considered correct and we're pleased that the formatting is no longer dependent upon the presence/absence of additional bounds (as it was in 2021 and below style editions)
based on the discussion though, it's very conceivable that we'd want to do something different for the next style edition so because of that as well as the desire to start freezing the 2024 edition, we're not going to update the style guide text at this time
please feel free to weigh in and correct me @rust-lang/style but wanted to post a summary to unlock the rustfmt team
This is related to rust-lang/rustfmt#5892. To summarize, there are inconsistencies when formatting Type Alias Bounds with rustfmt when using different
style_edition
values.Using
style_edition={2015|2018|2021}
produces the following output:and using
style_edition=2024
produces the following output:The Type Alias Section of the Style Guide, doesn't give any prescription for how to break or handle the indentation of the bounds.
In rust-lang/rustfmt#6293, it was suggested that the Type Alias Bounds should be similar to those for Trait Bounds, and therefore produce the following formatting:
So I'm wondering what the correct formatting should be, and if the Style Guide should be updated to provide clearer guidance on this.
Another question I have is how should Type Alias Bounds be formatted in this following case:
The text was updated successfully, but these errors were encountered: