Skip to content

Rustdoc should show "where" in a new line #20176

@mitsuhiko

Description

@mitsuhiko

It becomes very hard to read certain signatures at the moment. A good example is HashMap::get:

fn get<Sized? Q>(&self, k: &Q) -> Option<&V> where Q: Hash<S> + Eq + BorrowFrom<K>

This would be a lot easier to read (assuming ?Sized lands) like this:

fn get(&self, k: &Q) -> Option<&V>
  where Q: ?Sized + Hash<S> + Eq + BorrowFrom<K>

Reasoning being that right now the important part (return value) is lost somewhere in the middle whereas the trait bounds (which very often are not as important) are on the easier to read, end of the line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions