Skip to content

rustdoc: highlight default enum variant #133174

Closed as not planned
Closed as not planned
@H2WO4

Description

@H2WO4

Problem

It would be convenient and help readability if enum variants marked with #[default] in the code would be also marked as such in the documentation.

While it is certainly possible to just use a doc comment, it would be better to have a standardized automatic solution.

Proposed Solution

Displaying (default) next to the default variant would be more than sufficient.

Quick mockup of what it could look like:
Image

Additionally, pre- or postfixing the variant with a symbol could also be a viable solution.

Notes

A similar issue was already created in the docs.rs repository but closed as it should have been opened here.

This would only apply to variant using the #[default] attribute; manual Default impls would clearly be out of scope (due to the insanity of parsing the behavior of such a function).

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-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