Open nyarly opened 6 years ago
AFAIK rustdoc will render reexported items "as if" they're placed at the reexported location if they're not reachable from anywhere else in the documented crate (which is always the case for things defined in other crates). This does make sense as it makes it easy to have a different internal organization inside the crate while still having nice documentation that hides the internal structure.
I agree it might be nice to have some indication that a type is reexported from a different crate though.
There is a way for crates to opt out of re-exports being inlined: #[doc(no_inline)]
. You could ask the hyper devs to consider applying that attribute to its http
re-exports.
c.f. https://docs.rs/hyper/0.12.2/hyper/index.html and https://docs.rs/hyper/0.12.2/hyper/struct.Response.html
Based on that documentation, it appears that
Response
is part of thehyper
crate, when it's definition there is https://github.com/hyperium/hyper/blob/master/src/lib.rs#L39-L48 (pub use fromhttp
).This was especially confusing to me because I wanted to pass the result of
Response::builder()
between functions in my own code. I was surprised to discover that I'd need to addhttp
as a direct dependency in my Cargo.toml.The
pub use
lines referring to internal modules withinhyper
are reported that way, but the re-exports fromhttp
are both not listed in the "Re-exports" section, and they're presented as if they were defined inhyper
.