Skip to content

re-exported macro_export doc(hidden) pub use macro_rules macro not showing up #129982

@GlenDC

Description

@GlenDC

Let's say you have two crates

  • Crate A and Crate B
  • Crate A imports crate B, and re-exports its modules

In crate B you have something like

//! crate B : lib.rs

pub mod whatever {
#[macro_export]
#[doc(hidden)]
macro_rules! __foo { ... }

#[doc(inline)]
pub use crate::__foo as foo;
}

As well as in crate A:

//! crate A : lib.rs

#[doc(inline)]
pub use ::crate_b::whatever;

What I now have is that if you would open the docs for crate B you can see in module whatever that the foo macro is there. Nice

However if you open the docs of crate A you notice that in A::whatever there is no macro foo visible at all.. You can use it within your code as A::whatever::foo but it doesn't show in the docs... Editor does also code hints it (rust analyzer?).

I think this is either a bug, or me just running into limits of this hack, or perhaps I do it wrong?

This is a simplified example of what i have in my rama crates.

For example:

And yes these are two different commits, but trust me I tried it locally and it's the same. I don't have public edge builds for the individual crates.

repo: https://github.com/plabayo/rama

Anyway, hope my minimal example above is already enough...

Meta

rustc --version --verbose:

rustc 1.80.1 (3f5fd8dd4 2024-08-06)
binary: rustc
commit-hash: 3f5fd8dd41153bc5fdca9427e9e05be2c767ba23
commit-date: 2024-08-06
host: aarch64-apple-darwin
release: 1.80.1
LLVM version: 18.1.7

As requested I also tested it locally with rust version 1.83.0-nightly (4ac7bcbaa 2024-09-04), but same-same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc 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