rustdoc-json: Structured representation of attributes #141358
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-rustdoc-json
Area: Rustdoc JSON backend
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
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 Attr
with 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
The text was updated successfully, but these errors were encountered: