Open
Description
There's a lot of pain points that come up over time about rustdoc and reexports, and there's a lot of open issues as well, so this is going to serve as a metabug connecting all of them:
- When a name is reexported across crates, the source crate does not show where it was reexported as (often the more canonical location). List re-exports of a symbol in the documentation for that symbol #13414
- Lifetime parameters on functions can be lost. Inlined documentation loses lifetime parameters on functions #14462
- Private implementors are showing up. Inlined documentation reveals private implementors #14586
- Search results return more than one instance. rustdoc: do something about reexported items #15723
- Information about type aliases is lost across crates. rustdoc: reexported type aliases are not preserved in function signatures #15823
- Methods can be missing from the search index. Rustdoc search index missing some re-exported methods #20246
- Macro source looks... interesting. Src Link in Rustdoc fails for assert_eq! #21311
- Incoming hyperlinks go to the source crate, not the "canonical location". Rustdoc links to std library types can bypass the facade #22083
- Some
Self: Sized
bounds are lost. rustdoc: Self: Sized bounds in different crates are pruned #24183 - Sometimes reexports just don't show at all In some cases, types reexported out of private modules do not show up in rustdoc #24296
- Inclusion changes order of impl blocks doc inclusion (reexport) changes order of impl blocks #32290
- Only type namespace shows up when processing re-export of private module rustdoc prioritises documenting reexports from the type namespace #34843
- Re-exported enum variants don't show up in documentation Missing documentation when re-exporting enumeration variants #35488
- Many times re-exported type shows wrong documentation page Many times re-exported type shows wrong documentation page #37608
This is just a list of the current set of bugs, there have been countless others that have been fixed over time. Some of these are fundamental limitations, some of these are just bug fixes. I think that a huge part of "truly fixing this" will be tracking where the "canonical location" for a type is. For example rustdoc should understand that Vec
traditionally comes from the standard library, not libcollections
, and all incoming links, references, etc, should go there.
I'll try to keep this updated over time!