-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
rustdoc-json: Structured representation of attributes #141358
Copy link
Copy link
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-rustdoc-jsonArea: Rustdoc JSON backendArea: Rustdoc JSON backendC-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.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-rustdoc-jsonArea: Rustdoc JSON backendArea: Rustdoc JSON backendC-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Today, rustdoc-json presents attributes as a
Vec<String>rust/src/rustdoc-json-types/lib.rs
Lines 179 to 196 in 356f2d0
This means that users wanting to use these attributes (and not just display them) must implement a parser for these strings. It'd be nice if rustdoc exposed the semantics of the attribute, and not just the syntax.
This'd mean going from
Vec<String>toVec<Attr>, and adding someenum Attrwith all the possible kinds of attribute. The exact details would require design work. See #137645 (comment) for more detail.Possibly this should wait untill the state of rustc's own attribute system is more settled (#131229).
CC @jdonszelmann @obi1kenobi