Open
Description
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>
to Vec<Attr>
, and adding some enum 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).