Currently, Item::attrs uses a debug-printing
Stringified versions of parsed attributes on this item.
Essentially debug printed (e.g. #[inline] becomes something similar to #[attr="Inline(Hint)"]).
Equivalent to the hir pretty-printing of attributes.
https://github.com/rust-lang/rust/blame/85abb276361c424d64743c0965242dd0e7b866d1/src/rustdoc-json-types/lib.rs#L123-L126
This isn't particularly friendly to users, who need to deal with an internal (and undocumented 😱) attr representation.
This was changed in #135726, as part of the a larger attribute rework (#131229)
MCVE:
#[repr(C)]
pub struct Foo(i32);
which produces (abridged):
"1": {
"attrs": ["#[attr=\"Repr([ReprC])\")]\n"],
"inner": {
"struct": {
"generics": {"params": [], "where_predicates": []},
"impls": [2, 4, 6, 8, 10, 12, 15, 19, 23, 26, 31, 36, 39],
"kind": {"tuple": [null]}
}
},
"name": "Foo",
}
CC @jdonszelmann @obi1kenobi
Currently, Item::attrs uses a debug-printing
https://github.com/rust-lang/rust/blame/85abb276361c424d64743c0965242dd0e7b866d1/src/rustdoc-json-types/lib.rs#L123-L126
This isn't particularly friendly to users, who need to deal with an internal (and undocumented 😱) attr representation.
This was changed in #135726, as part of the a larger attribute rework (#131229)
MCVE:
which produces (abridged):
CC @jdonszelmann @obi1kenobi