Skip to content

[rustdoc] --generate-macro-expansion only shows last expanded item in a macro call #157508

Closed

Description

@GuillaumeGomez

Part of #148222.

Example from https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_hir/attrs/pretty_printing.rs.html#194:

print_skip!(Span, (), ErrorGuaranteed, AttrId);

gets expanded into:

impl PrintAttribute for AttrId {
    fn should_render(&self) -> bool { false }
    fn print_attribute(&self, _: &mut Printer) {}
}

The print_skip macro code:

macro_rules! print_skip {
    ($($t: ty),* $(,)?) => {$(
        impl PrintAttribute for $t {
            fn should_render(&self) -> bool { false }
            fn print_attribute(&self, _: &mut Printer) { }
        })*
    };
}

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 5, 2026
  2. added
    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.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 5, 2026
  3. added a commit that references this issue on Aug 27, 2026
    ee68634
  4. added 3 commits that reference this issue on Aug 28, 2026
    fcf591f
    9692fd2
    a601c1e
  5. added a commit that references this issue on Aug 28, 2026
    e4750fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-bugCategory: This is a bug.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