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
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
I tried this code:
I expected to see this happen: both macros listed under
parentInstead, this happened: only
wild_macrois listed underparentMeta
rustc --version --verbose: