-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Inconsistent rustdoc constant expansion from macro #115295
Copy link
Copy link
Closed
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.Category: This is a bug.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
Activity
Metadata
Metadata
Assignees
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.Category: This is a bug.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.
I tried this code:
I expected to see this happen: constants are formatted as either all
{ _ }, or all42.Instead, this happened: the one in the trait generic is formatted as the literal
42, while everywhere else it's formatted as{ _ }.I assume it's this:
rust/src/librustdoc/clean/utils.rs
Lines 436 to 438 in 8550f15
which can be expanded on to also format the literal if it's coming from a macro span by using the pretty printer.
Meta
rustc --version --verbose:Backtrace
@rustbot label A-rustdoc-ui T-rustdoc