Skip to content

rustdoc type-based search appears to not support searching by built-in types #60485

Open

Description

@nagisa

You can search for functions that appear to satisfy some sort of a shape/type as such input -> output, however that will not work for more complicated searches involving built-in types, including:

  • slices [T] -> *;
  • pointers *mut T -> *;
  • tuples (*, *);
    • and similarly multiple arguments
  • probably more.

Instead of attempting to guess a what kind of search this is based on -> I propose that we add another "type" indicating that this is a signature we’re looking for and take a type of the function pointer as an argument, so something like this would work:

  • sig:fn([T]) -> *
  • sig:fn(*mut T) -> T
  • `sig:(A, B)
  • sig:...

Activity

  1. added
    C-bugCategory: This is a bug.
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on May 2, 2019
  2. GuillaumeGomez commented on May 2, 2019

    @GuillaumeGomez
    Member

    Ah no, I didn't support that at all.

  3. jyn514 commented on Jul 25, 2020

    @jyn514
    Member

    You can search for functions that appear to satisfy some sort of a shape/type as such input -> output, however that will not work for more complicated searches involving built-in types, including:

    This doesn't seem to work currently ... https://doc.rust-lang.org/std/?search=OsString%20-%3E%20String doesn't give anything.

    Related: rust-lang/docs.rs#494 (comment)

  4. GuillaumeGomez commented on Jul 26, 2020

    @GuillaumeGomez
    Member

    Very likely. I didn't enforce tests on this part and focused on the others so it's likely that it's broken.

  5. added a commit that references this issue on Feb 1, 2021
  6. added a commit that references this issue on Feb 2, 2021
  7. 6 remaining items

  8. added a commit that references this issue on Mar 11, 2024
  9. added a commit that references this issue on Mar 11, 2024
  10. added a commit that references this issue on Mar 14, 2024
  11. added a commit that references this issue on Mar 14, 2024
  12. added 2 commits that reference this issue on Mar 14, 2024
  13. added a commit that references this issue on Mar 14, 2024
  14. added a commit that references this issue on May 5, 2024
  15. added a commit that references this issue on May 5, 2024
  16. lolbinarycat commented on Aug 24, 2025

    @lolbinarycat
    Contributor

    support for raw pointers was added in #145731, and slices and tuples seem to have been added a while ago. unsure if there are any primitive types still not supported.

  17. ijackson commented on Aug 25, 2026

    @ijackson
    Contributor
  18. GuillaumeGomez commented on Aug 25, 2026

    @GuillaumeGomez
    Member

    So arrays are still not supported, noted.

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-type-based-searchArea: Searching rustdoc pages using type signaturesC-bugCategory: This is a bug.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

      Issue actions