Skip to content

Rustdoc source links should link into expanded macros rather than to the macro invocation #146007

Open

Description

@VorpalBlade

This is a followup from discussing PR #137229 on reddit.

Specially that PR added the ability to (unstably) expand macros in rustdoc source view. A great next step would be to have links from the docs to the source to go into the expanded macro. For example: the methods on u32 currently point to the macro invocation but could point into the expanded macro. This would make it a lot easier to see the source for the integer types and other types where it macros are used to define the impl blocks.

Cc @GuillaumeGomez

@rustbot label -C-bug

(Please fix the labels, I couldn't find a suitable template for this, so I selected rustdoc bug.)

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Aug 29, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    and removed
    C-bugCategory: This is a bug.
    on Aug 29, 2025
  3. GuillaumeGomez commented on Aug 29, 2025

    @GuillaumeGomez
    Member

    Added to my TODO list, thanks!

  4. added
    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 29, 2025
  5. added
    T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
    on Aug 29, 2025
  6. added
    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
    on Oct 10, 2025
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-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-rustdoc-searchArea: Rustdoc's search featureC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions