pre-RFC: List all re-exported items, including those imported by wildcards, in rust docs

Originally contemplated here: feature request: collapsable tree view for items included via pub re-exports · Issue #2310 · rust-lang/ · GitHub

Right now many crates will do large public re-exports of a prelude or something that possibly includes many other public re-exports, where it is rather difficult to figure out what is actually included in that export without directly querying the language server. The most difficult cases are scenarios like this:

pub use some_module::prelude::*;

But then you go to visit the prelude module, and you find that it in turn has a bunch of glob re-exports, so it becomes very difficult (without talking to the language server) to know what items are actually included.

Rust docs could make this a lot easier if there were a collapsible tree view listing all re-exported items in the current module, instead of just listing the re-export statements like it does now. For items that are specifically re-exported, this is currently fine, but for wildcard re-exports, it is impossible to know without visiting the other module what items are actually coming in, and this is of course exacerbated when we have glob re-exports of glob re-exports of glob re-exports...

For example there could be "Re-Exported Structs:", "Re-Exported Modules:", "Re-Exported Traits", etc.

I think something like this would dramatically improve the dev UX of rust docs for a wide swathe of the crate ecosystem.


I like the idea. Does #[doc(inline)] do anything on glob imports at the moment? If not, it could be used for that.

1 Like