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

Full paths in type-based search don't work #114522

Closed
notriddle opened this issue Aug 5, 2023 · 1 comment · Fixed by #115436
Closed

Full paths in type-based search don't work #114522

notriddle opened this issue Aug 5, 2023 · 1 comment · Fixed by #115436
Assignees
Labels
A-rustdoc-search Area: Rustdoc's search feature A-type-based-search Area: Searching rustdoc pages using type signatures 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

@notriddle
Copy link
Contributor

While searching vec -> usize works, vec::vec -> usize doesn't.

@notriddle notriddle added A-type-based-search Area: Searching rustdoc pages using type signatures A-rustdoc-search Area: Rustdoc's search feature labels Aug 5, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 5, 2023
@saethlin saethlin added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 5, 2023
@inquisitivecrystal inquisitivecrystal added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Aug 14, 2023
@GuillaumeGomez
Copy link
Member

Taking a look.

@GuillaumeGomez GuillaumeGomez self-assigned this Sep 1, 2023
@bors bors closed this as completed in 3ec4b3b Sep 3, 2023
RalfJung pushed a commit to RalfJung/miri that referenced this issue Sep 3, 2023
…ddle

[rustdoc] Fix type based search

Fixes rust-lang/rust#114522.

The problem was a bit more tricky than I originally thought it would be: we only kept type ID and generics in short, but as soon as there was a full path in the user query, the element didn't get an ID anymore because the ID map didn't know about `x::y` (although it knew about `y`). So for this first problem, I instead always pass the element name to get the ID.

Then a new problem occurred: we actually needed to check if paths matched, otherwise whatever the path, as long as the "end types" match, it's all good. meaning, we needed to add path information, but to do so, we needed it to be added into the search index directly as there was no mapping between `"p"` and `"q"`.

I hope this explanation makes sense to someone else than me. ^^'

r? `@notriddle`
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 A-type-based-search Area: Searching rustdoc pages using type signatures 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

Successfully merging a pull request may close this issue.

5 participants