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

hashbrown's trait implementations appear in std docs #62763

Closed
17cupsofcoffee opened this issue Jul 17, 2019 · 8 comments
Closed

hashbrown's trait implementations appear in std docs #62763

17cupsofcoffee opened this issue Jul 17, 2019 · 8 comments
Assignees
Labels
A-collections Area: std::collections. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-libs-api Relevant to the library API team, 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.

Comments

@17cupsofcoffee
Copy link

17cupsofcoffee commented Jul 17, 2019

Perhaps this is a known issue, but I've noticed that since hashbrown was integrated into the standard library, impls from that crate now show up under the 'Implementations on Foreign Types' section of the trait docs.

This is unfortunate, since the hashbrown versions of those types aren't actually accessible through std (std::collections::HashMap and std::collections::HashSet are effectively newtypes wrapping them). Adding to the confusion, these seem to get precedence naming-wise over the actual implementations that you can use, which are referred to by their fully qualified names further down the page.

I'm not sure if anything can actually be done about this without changes to rustdoc, and it's not a huge deal, but I figured it was worth raising :)

@17cupsofcoffee 17cupsofcoffee changed the title hashbrown's trait implementations appear in std docs hashbrown's trait implementations appear in std docs Jul 17, 2019
@jonas-schievink jonas-schievink added A-collections Area: std::collections. C-bug Category: This is a bug. T-libs-api Relevant to the library API team, 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. labels Jul 17, 2019
@GuillaumeGomez
Copy link
Member

I only saw hashbrown in examples. If so, it can be fixed easily. Or did I miss something?

@GuillaumeGomez GuillaumeGomez self-assigned this Jul 19, 2019
@GuillaumeGomez
Copy link
Member

I just realised that it's not linking to std types apparently, which is weird... Also, I think we should "hide" the hashbrown types if possible since I *think* they're public for the moment.

@17cupsofcoffee
Copy link
Author

17cupsofcoffee commented Jul 19, 2019

The std types do have links - what I'm getting at is that the first HashMap and HashSet listed aren't the std ones :p They're hashbrown::HashMap and hashbrown::HashSet, hence why the examples match the ones shown on that crate's docs. Those impls are the ones from hashbrown that the std wrapper types forward on to.

You could #[doc(hidden)] those impl blocks, but then they'd vanish from hashbrown's docs as well, which isn't ideal.

@GuillaumeGomez
Copy link
Member

The std types do have links - what I'm getting at is that the first HashMap and HashSet listed aren't the std ones :p

That's what I meant when I wrote "I just realised that it's not linking to std types apparently, which is weird..." (badly said though).

What's difficult is that we have types depending on std types which depend on those types. Circular documentation, I think that's a first haha!

@Mark-Simulacrum
Copy link
Member

We should probably apply #![cfg_attr(feature = "rustc_internal_api", doc(hidden))] on the crate? Presumably that'll work, though not sure if we directly re-export any part of hashbrown from std...

@Mark-Simulacrum Mark-Simulacrum added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools and removed T-libs-api Relevant to the library API team, 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. labels Aug 6, 2019
@17cupsofcoffee
Copy link
Author

As far as I can tell, the only usages of hashbrown are in map.rs, and they're all private.

@jonas-schievink jonas-schievink added T-libs-api Relevant to the library API team, 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. labels Mar 6, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 15, 2020

I think this was fixed by #76571 - @17cupsofcoffee can you double check?

@17cupsofcoffee
Copy link
Author

Yes, the issue seems to be fixed - the only HashMap mentioned on that page now is the std one 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-collections Area: std::collections. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-libs-api Relevant to the library API team, 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.
Projects
None yet
Development

No branches or pull requests

5 participants