Skip to content

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

Closed
@camelid

Description

@camelid
Member

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

Activity

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
on Nov 4, 2020
jyn514

jyn514 commented on Nov 4, 2020

@jyn514
Member

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

jyn514 commented on Nov 4, 2020

@jyn514
Member

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

camelid

camelid commented on Nov 4, 2020

@camelid
MemberAuthor

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

jyn514 commented on Nov 4, 2020

@jyn514
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-searchArea: Rustdoc's search featureC-enhancementCategory: An issue proposing an enhancement or a PR with one.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

        Participants

        @jyn514@camelid

        Issue actions

          rustdoc: Only show the original item for re-exported items in search results · Issue #78719 · rust-lang/rust