List re-exports of a symbol in the documentation for that symbol #13414
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-dev-tools
Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
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.
The text was updated successfully, but these errors were encountered: