Skip to content

rustdoc: indicate when a trait has non-defaulted hidden items #138697

Open
@GoldsteinE

Description

@GoldsteinE

There’s a pattern of hiding a non-defaulted item in a trait to mark it as non-implementable, e.g. inventory::Collect:

https://github.com/dtolnay/inventory/blob/5e915d4d197432b73375ad21e08a1ee8275d8309/src/lib.rs#L224-L227

This is primarily useful when a trait is implemented by a macro, so it can’t be properly sealed, but still needs to be only implementable by code “originating” in the same crate. It has some similarity with #[non_exhaustive] attribute.

Some options on how this could look:

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.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