Skip to content

Re-export a declarative macro isn't rendered by rustdoc if named explicitly #154694

@epage

Description

@epage

I tried this code:

$ cat src/lib.rs
#[macro_use]
mod macros;

pub mod parent;

$ cat src/macros.rs
/// Explicit macro
#[doc(hidden)]
#[macro_export]
macro_rules! explicit_macro {
    () => {};
}

/// Wild macro
#[doc(hidden)]
#[macro_export]
macro_rules! wild_macro {
    () => {};
}

$ cat src/parent/mod.rs
mod child_explicit;
mod child_wild;

pub use child_explicit::explicit_macro;
pub use child_wild::*;

$ cat src/parent/child_explicit.rs
#[doc(inline)]
pub use crate::explicit_macro;

$ cat src/parent/child_wild.rs
#[doc(inline)]
pub use crate::wild_macro;

$ cargo doc

I expected to see this happen: both macros listed under parent

Instead, this happened: only wild_macro is listed under parent

Image

Meta

rustc --version --verbose:

rustc 1.94.0 (4a4ef493e 2026-03-02)
binary: rustc
commit-hash: 4a4ef493e3a1488c6e321570238084b38948f6db
commit-date: 2026-03-02
host: x86_64-unknown-linux-gnu
release: 1.94.0
LLVM version: 21.1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions