Skip to content

rustdoc ui doesn't show associated types for folded summaries of trait implementations #142782

Open
@kornelski

Description

@kornelski

For traits like Iterator or Future, it's essential to know what is their associated type. However, lists of trait implementations can be folded into a summary, and the summary hides the associated type.

The detailed list of trait implementations for a type can be quite long, so it's easier to scan it with all items folded into summaries (using top-right summary button). That makes the trait implementations also less informative:

impl Iterator for Foo

type Item = Bar

I think the summaries could be made more useful by including the associated type in the summary somehow:

impl Iterator for Foo // Item = Bar

and the redundant annotation can be hidden when the details are expanded, with a bit of CSS trickery:

<style>
    details[open] > summary span {
        display: none;
    }
</style>
<details>
    <summary>impl Iterator for Foo <span>// Item = Bar</span></summary>
    type Item = Bar
</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions