Skip to content

rustdoc: do something about reexported items #15723

Open
@SimonSapin

Description

@SimonSapin

Update: This issue was first filed with the title "rustdoc shouldn’t document reexports separately", but that might not be the desired solution.


For example, the StrSlice trait is currently documented in three different places:

http://doc.rust-lang.org/std/str/trait.StrSlice.html
http://doc.rust-lang.org/collections/str/trait.StrSlice.html
http://doc.rust-lang.org/core/str/trait.StrSlice.html

It really is the same trait, but in the documentation they appear as distinct.

I think that, when module A contains a pub use B::C; statement:

  • rustdoc should not create a new documentation page for A::C
  • Instead, the documentation for A should link to the original documentation for B::C
  • In addition, the documentation for B::C should list all the known name it is re-exported as (in this case A::C).

It gets more complicated when A and B are not in the same source repository, but IMO still worth pursuing. Sphinx does support cross-references to other repos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions