Open
Description
I don't have time for a full write-up of this right now, so I'm just opening an issue so I have somewhere to point people when they open rustdoc issues.
Motivation:
- search items are duplicated (rustdoc: do something about reexported items rust#15723)
- rustdoc sometimes links to the original definition, even for facade crates that use inlining: Rustdoc links to std library types can bypass the facade rust#22083
- ditto, but for intra-doc links: Rustdoc links items in the standard library to the original crate, not the re-export rust#78467 (deemed to be a duplicate of the issue above)
- rustdoc sometimes links to a re-export, even when it is named differently than the link the user wrote: rustdoc: Incorrect link to item when the item is reexported and inlined rust#83976
doc(canonical)
could tell rustdoc the 'one true path' the item should appear at.
Possible difficulties:
doc(canonical)
is necessarily unique across all crates. rustdoc should give an error if it's duplicated.- rustdoc currently stores search-index.json per-crate. This will need a redesign if rustdoc only know to hide the item after the documentation has been generated and it goes onto the next crate
Unresolved questions:
- Does inlining still make sense with
doc(canonical)
? Should all other usages just link to the canonical crate? How does this work if the canonical usage is in a reverse-dependency?
cc @camelid