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

rustdoc: Only show the original item for re-exported items in search results #78719

Closed
camelid opened this issue Nov 4, 2020 · 4 comments
Closed
Labels
A-rustdoc-search Area: Rustdoc's search feature 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

@camelid
Copy link
Member

camelid commented Nov 4, 2020

Currently rustdoc will show all items that match the query string, even re-exported ones, which can be kind of frustrating when I get a bunch of results that are actually all the same thing:

image

I propose that instead we only index the original item, not any of the re-exports. I am not saying that we don't inline documentation from the original, just that we only store the original in the search index.

See also: #15723, #24305

@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. A-rustdoc-search Area: Rustdoc's search feature labels Nov 4, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 4, 2020

The original is not usually the canonical one, though :/ consider std::collections::HashMap, which is actually defined in std::collections::hash::map::HashMap.

I've been wanting #[canonical] for a while now and I think this would fit, see https://discord.com/channels/442252698964721669/459149231702278154/771465736190558258 for some discussion. Sorry I don't have a write-up anywhere.

@jyn514
Copy link
Member

jyn514 commented Nov 4, 2020

@camelid why did you open a new issue instead of using #15723? Is there something else going on?

@camelid
Copy link
Member Author

camelid commented Nov 4, 2020

My understanding was that this issue is a subset of what's talked about in #15723, and this way we have a way to track just this part of it. It looks like QuietMisdreavus commented about this at #15723 (comment), but it was long enough that I hadn't fully read it before :)

@jyn514
Copy link
Member

jyn514 commented Nov 4, 2020

I don't think there's anything in #15723 not covered here. The things listed in the description are just suggestions for fixing it, but after the discussion later in the issue it looks like they won't be the way it ends up being fixed.

@jyn514 jyn514 closed this as completed Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature 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

2 participants