Closed H2WO4 closed 1 hour ago
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
This feature request was FCP-closed in https://github.com/rust-lang/rust/pull/115575. Please see that PR and the linked issue for the rationale.
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:
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; manualDefault
impls would clearly be out of scope (due to the insanity of parsing the behavior of such a function).