Format issue on supertrait with bounds on associated types.
Open
Nobody has claimed this yet.
I-poor-formatting
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
For all version I could tests (master and nightly)
this code:
pub trait MyLongTraitName:
MyLongBoundName<
MyLongAssociatedType:
SomeAnotherBound<
YetAnotherType: YetAnotherBound,
YetAnotherType2: YetAnotherBound2
>,
OtherType: SmallBound
+ SmallBound2
+ AnotherLongBound<
WithSomeType: BeingBound,
WithSomeType2: BeingBound,
WithSomeType3: BeingBound
>
+ SmallBound3
+ AnotherLongBound2<
WithSomeType: BeingBound,
WithSomeType2: BeingBound,
WithSomeType3: BeingBound
>,
>
{
}
fn main() {}
gets formatted into:
pub trait MyLongTraitName:
MyLongBoundName<
MyLongAssociatedType: SomeAnotherBound<
YetAnotherType: YetAnotherBound,
YetAnotherType2: YetAnotherBound2,
>,
OtherType: SmallBound
+ SmallBound2
+ AnotherLongBound<
WithSomeType: BeingBound,
WithSomeType2: BeingBound,
WithSomeType3: BeingBound,
> + SmallBound3
+ AnotherLongBound2<
WithSomeType: BeingBound,
WithSomeType2: BeingBound,
WithSomeType3: BeingBound,
>,
>
{
}
fn main() {}
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.
Research direction
Reproduce the formatting difference with the supplied Rust snippet using rustfmt on the reported versions. Trace how supertraits with bounds on associated types are formatted; done means the input no longer produces the incorrect indentation and the expected formatting is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100