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: Use the concrete type of self in the search-index #92205

Closed
camelid opened this issue Dec 22, 2021 · 5 comments · Fixed by #96652
Closed

rustdoc: Use the concrete type of self in the search-index #92205

camelid opened this issue Dec 22, 2021 · 5 comments · Fixed by #96652
Labels
A-rustdoc-search Area: Rustdoc's search feature A-type-based-search Area: Searching rustdoc pages using type signatures C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented Dec 22, 2021

See the discussion starting at #90630 (comment).

EDIT (@GuillaumeGomez): For example:

pub struct Foo;

impl Foo {
    pub fn something(&self) -> PathBuf { ... }
}

For the example above, if you use Foo -> PathBuf in the search, something won't show up because &self isn't "recognized"/"generated" in the search index as Foo.

@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-type-based-search Area: Searching rustdoc pages using type signatures A-rustdoc-search Area: Rustdoc's search feature labels Dec 22, 2021
@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Dec 22, 2021

I don't really have an opinion on this: it seems a bit counter-intuitive for me to look for Foo (from the example above) inside the arguments of its methods but I can see the value of it too. A bit tricky.

@camelid
Copy link
Member Author

camelid commented Dec 22, 2021

I think it's really bizarre for vec -> usize to not return Vec::capacity. Many uses of a type are in its methods; if we don't make this change, those will just be ignored.

@GuillaumeGomez
Copy link
Member

I'm strongly biased here because it's how it's always been. But I think it'd be a good change. 👍

@jsha
Copy link
Contributor

jsha commented Dec 22, 2021

I agree, this would be a good change. I would expect a search for vec -> usize to return Vec::capacity.

@GuillaumeGomez
Copy link
Member

Just to keep everyone updated here: once #90630 is merged, I'll work on this.

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-bug Category: This is a bug. 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.

3 participants