Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate more descriptive paths for items which have the same name in Rustdoc #74924

Closed
RDambrosio016 opened this issue Jul 29, 2020 · 3 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@RDambrosio016
Copy link
Contributor

Currently rustdoc does not attempt to disambiguate between traits which have the same name and are used somewhere, say, implemented traits. This makes for an interesting time trying to figure out what it is actually implementing at a glance. The best example ive found is serde libraries and their Error struct: https://docs.serde.rs/serde_json/struct.Error.html#trait-implementations
It is not very easy to see what it is implementing at a glance. This could likely be solved by seeing if multiple names clash in the same "section" and if so, generating the full path. In which case it would generate something along the lines of

proposal
#73996 Could offer insights into how to implement this too.

@jyn514 jyn514 added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 29, 2020
@joshtriplett
Copy link
Member

I would love to see this as well. An example from the standard library: https://doc.rust-lang.org/std/process/struct.Command.html . Notice how both impls of CommandExt look identical but refer to different traits.

@jhpratt
Copy link
Member

jhpratt commented Aug 9, 2020

Another example is the time crate, where traits are frequently implemented on both time::Duration and std::time::Duration. In some places, it will output the latter as StdDuration (due to aliased imports). Having this feature would be great and would provide a significant amount of clarity to end-users.

@jyn514
Copy link
Member

jyn514 commented Aug 27, 2020

Closing as duplicate of #42066 (wow, this is certainly reported a lot!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants