rustdoc: awkward vertical spacing on trait bounds #85566
Labels
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
When a method does not have trait bounds, it is displayed all on one line. When a method has just one trait bound, it takes four lines:
There are some conflicting priorities here: On the one hand, it's nice for the layout to match what rustfmt does. On the other hand, it's good to use spacing to emphasize the parts of the documentation that are important. For instance, the
{ ... }
has a whole line to itself to convey one bit of information: this is a provided method, not a required one. Spacing is also useful to show that parts of the display are related to each other. In the above, it's not visually clear whether{ ... }
is part ofby_ref
or some independent item.I propose we change to this for methods with one trait bound:
And this for methods with multiple trait bounds:
Screen shot of nightly: https://doc.rust-lang.org/nightly/std/io/trait.Read.html
The text was updated successfully, but these errors were encountered: