Odd formatting of type def with many generics
Open
@johnhuichen is already working on this.
Since Aug 17, 2024.
A-2024-style-edition
I-poor-formatting
only-with-option
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
I'm seeing this behavior in rustfmt 1.6.0-nightly (c469197b 2023-08-22):
// Before (correct in stable)
type AAAAAAAAAAAAA: BBBBBBBBBBBBBBB<
CCCCCCCCCCCCCCCCC,
DDDDDDDDDDDDDDDDD,
EEEEEEEEEEEEEEEEE,
FFFFFFFFFFFFFFFFF,
GGGGGGGGGGGGGGGGG,
HHHHHHHHHHHHHHHHH,
IIIIIIIIIIIIIIIII,
>;
// After (hopefully not correct)
type AAAAAAAAAAAAA: BBBBBBBBBBBBBBB<
CCCCCCCCCCCCCCCCC,
DDDDDDDDDDDDDDDDD,
EEEEEEEEEEEEEEEEE,
FFFFFFFFFFFFFFFFF,
GGGGGGGGGGGGGGGGG,
HHHHHHHHHHHHHHHHH,
IIIIIIIIIIIIIIIII,
>;
It's completely unclear to me what the expected behavior is at this point, but judging by https://github.com/rust-lang/rustfmt/issues/5577 (specifically this: https://github.com/rust-lang/rustfmt/issues/5577#issuecomment-1407489330), this is not what you want.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.