- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-rustdoc-jsonArea: Rustdoc JSON backendArea: Rustdoc JSON backendT-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.
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",
    }Enselic and jdonszelmannobi1kenobi and jdonszelmann
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-rustdoc-jsonArea: Rustdoc JSON backendArea: Rustdoc JSON backendT-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.