Open
Description
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.
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",
}