Skip to content

Tracking issue for documenting individual built-in inert attributes in the standard library using #[doc(attribute = "…")] #157604

Open

Description

@fmease

View all comments

Back in August 2025 we merged PR #142472 which added a mechanism for us to document built-in inert attributes in libcore/libstd in the form of a new internal attribute #[doc(attribute = "…")] to be placed on const _: () = ();. So far though, 9 months later, we haven't actually started documenting any attributes.

Important

Similar to the preexisting "keyword docs" in the std library, these proposed "built-in attribute docs" are not meant to "replace" or "compete" with the Rust Reference!

Instead, they're merely meant to represent a guide-level explanation, not a reference-level one. They're to be written in more beginner-friendly language and they needn't exhaustively describe each attribute.

Finally, each "entry" ought to link to the relevant part of the Rust Reference if available using a relative filesystem path not a URL to allow for offline reading. Preferably at the bottom.

If there are any issues with #[doc(attribute = "…")] itself, please create a new issue labeled T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. or open a topic in the #t-rustdoc Zulip channel.


Attributes to be documented:

This list intentionally does not include internal attributes.
Disclaimer: This list may contain errors and might be missing some attributes.

Activity

  1. added
    A-attributesArea: Attributes (`#[…]`, `#![…]`)
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    T-lang-docsRelevant to the lang-docs team.
    on Jun 8, 2026
  2. fmease commented on Jun 8, 2026

    @fmease
    MemberAuthor

    I don't actually know which team(s) are gonna be responsible for reviewing these PRs. Strictly speaking it should be T-lang-docs, right, but I don't think they have anything close to enough bandwidth. For keyword docs, it's actually T-libs & T-libs-contributors who approve these PRs in practice. T-compiler was recently asked to also review T-libs PRs, so that's also a group that can review these.

    cc @GuillaumeGomez @rust-lang/lang-docs

  3. fmease commented on Jun 8, 2026

    @fmease
    MemberAuthor

    Holding off on adding E-help-wanted Call for participation: Help is requested to fix this issue. until this tracking issue actually contains an exhaustive checklist of built-in inert attributes.

  4. added
    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
    on Jun 8, 2026
  5. changed the title [-]Tracking issue for documenting individual built-in attributes in the standard library using `#[doc(attribute = "…")]`[/-] [+]Tracking issue for documenting individual built-in inert attributes in the standard library using `#[doc(attribute = "…")]`[/+] on Jun 8, 2026
  6. traviscross commented on Jun 8, 2026

    @traviscross
    Contributor

    I don't actually know which team(s) are gonna be responsible for reviewing these PRs. Strictly speaking it should be T-lang-docs, right, but...

    Probably we (lang-docs) should take these, at least to start. We'll try to respin or hand off if we get behind. If the rate of these is low, as it has been for changes to the keyword docs (where I take assignment when I see them on nontrivial ones affecting stable features), it might be OK.

    Revising attribute documentation on the Reference side has been one of our big projects, so it's on the mind, and we'll want to ensure some alignment.

  7. added
    E-help-wantedCall for participation: Help is requested to fix this issue.
    on Jun 14, 2026
  8. softfault commented on Jun 15, 2026

    @softfault
    Contributor

    I'd like to work on the first attribute documentation PR for #[must_use]. Would that be a good starting point for this tracking issue?

  9. GuillaumeGomez commented on Jun 15, 2026

    @GuillaumeGomez
    Member

    Sure, go ahead.

  10. mejrs commented on Jun 16, 2026

    @mejrs
    Member

    This list intentionally does not include internal attributes.

    It would be nice to have a place where these are documented. That wouldn't be in the std crate docs, obviously. But I do sometimes struggle with using internal attributes and even minimal docs would be helpful.. Is there a place in the rustc workspace where this fits?

  11. GuillaumeGomez commented on Jun 16, 2026

    @GuillaumeGomez
    Member

    Well, using the same attribute in some rustc internal crate should do the trick. Otherwise in the rustc dev guide?

  12. traviscross commented on Jun 16, 2026

    @traviscross
    Contributor

    There is https://doc.rust-lang.org/nightly/nightly-rustc/index.html. Maybe it'd fit somewhere there.

  13. 86 remaining items

  14. added a commit that references this issue on Oct 4, 2026
  15. added a commit that references this issue on Oct 4, 2026
  16. added a commit that references this issue on Oct 10, 2026
  17. added a commit that references this issue on Oct 10, 2026
  18. kiana1kaslana commented on Oct 11, 2026

    @kiana1kaslana
    Contributor

    I'd like to claim windows_subsystem.

  19. krokodeyu commented on Oct 18, 2026

    @krokodeyu
    Contributor

    I'd like to claim crate_type.

  20. added a commit that references this issue on Oct 19, 2026
  21. added a commit that references this issue on Oct 19, 2026
  22. added 3 commits that reference this issue on Oct 21, 2026
  23. added a commit that references this issue on Oct 21, 2026
  24. added a commit that references this issue on Nov 8, 2026
  25. added a commit that references this issue on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.S-tracking-impl-incompleteStatus: The implementation is incomplete.T-lang-docsRelevant to the lang-docs team.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions