-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: 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.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
When rustdoc renders a const
item, it will print the actual (evaluated) value for primitives. For example, https://doc.rust-lang.org/std/i32/constant.MAX.html:
It would be useful to do the same for ADT values (structs, enums, and unions). For example:
struct Foo { val: bool }
const fn make_foo() { Foo { val: true } }`
const FOO: Foo = make_foo()
would print something like:
Foo {
val: true
}
on the page for FOO
.
ecton and joseluis
Metadata
Metadata
Assignees
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: 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.Relevant to the rustdoc team, which will review and decide on the PR/issue.