-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Description
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:
- you can see nicely here the
match_service
macro: https://docs.rs/rama-http/0.2.0-alpha.2/rama_http/service/web/index.html - however in https://ramaproxy.org/docs/rama/http/service/web/index.html you do not see it :/
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.