Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: highlight default enum variant #133174

Closed
H2WO4 opened this issue Nov 18, 2024 · 2 comments
Closed

rustdoc: highlight default enum variant #133174

H2WO4 opened this issue Nov 18, 2024 · 2 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@H2WO4
Copy link

H2WO4 commented Nov 18, 2024

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

@H2WO4 H2WO4 added C-feature-request Category: A feature request, i.e: not implemented / a PR. S-triage labels Nov 18, 2024
@weihanglo
Copy link
Member

The rustdoc binary controls over how the HTML output looks like so this should be submitted to rust-lang/rust where rustdoc resides.

@rustbot transfer rust

@rustbot rustbot transferred this issue from rust-lang/cargo Nov 18, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 18, 2024
@weihanglo weihanglo changed the title cargo doc: highlight default enum variant rustdoc: highlight default enum variant Nov 18, 2024
@ehuss ehuss added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Nov 18, 2024
@fmease
Copy link
Member

fmease commented Nov 18, 2024

This feature request was FCP-closed in #115575. Please see that PR and the linked issue for the rationale.

@fmease fmease closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@fmease fmease added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. S-triage labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

No branches or pull requests

5 participants