Skip to content

List re-exports of a symbol in the documentation for that symbol #13414

Closed
@Meyermagic

Description

@Meyermagic

I find myself accidentally re-importing things already in prelude, or using a deeper, explicit, path for something re-exported elsewhere pretty often.

When navigating the documentation via search, I'll jump directly to a sub-module or symbol, and import and use it without noticing I already have, say, std::io imported. Then I'll be using fs::File and, say, io::BufferedReader, when I could have cleaner import paths.

Overall, I think it might help new users become familiar with the standard library layout. The main downside I see is unnecessary clutter in the documentation pages, and obviously more code to maintain.

A lint might also work, although there are definitely cases where "use the shortest import path" probably isn't what you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.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