Poor line breaking of multi-item type parameter bounds featuring bracketed generic arguments
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
This is how rustfmt formats a long list of type parameter bounds featuring a long list of bracketed generic arguments:
type ProposeTransactionsFuture: Future<
Item = ProposeTransactionsResponse<Self::MessageId>,
Error = Error,
> + Send
+ 'static;
The first bound after the closing bracket is formatted inline and is visually obscured.
It would be better to break and align the top-level + separators:
type ProposeTransactionsFuture: Future<
Item = ProposeTransactionsResponse<Self::MessageId>,
Error = Error,
>
+ Send
+ 'static;
Edit: Or better yet, on suggestion by @topecongiro below:
type ProposeTransactionsFuture:
Future<
Item = ProposeTransactionsResponse<Self::MessageId>,
Error = Error,
>
+ Send
+ 'static;
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 Rust formatting example from the issue and trace rustfmt's handling of type parameter bounds and nested generic arguments. Identify the relevant formatting entry point and regression-test location, then make the top-level + separators break and align as shown in the preferred example.
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