Skip to content

rustdoc search: Match identifers at word breaks #154733

@aDotInTheVoid

Description

@aDotInTheVoid

Rustdoc search should support matching identifers at "word breaks", not just the start of the name. (I'm not sure that's how it actually works, but that's my intuition. Read on for where rustdoc-search fails to find something it should).

Code

pub mod dustc_hir {
    pub struct Stability;
}

Reproduction Steps

rustdoc +nightly dustc.rs

Then search "hir::Stability"

Expected Outcome

I'd expect this to find dustc::dustc_hir::Stability

Actual Output

Search finds no items.

Screanshot of rustdoc search for hir::Stability returning no items

Version

rustdoc 1.96.0-nightly (7e46c5f 2026-04-01)

Additional Details

Inspired by the search results for hir::Stability not returning rustc_hir::Stability

CC @notriddle

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.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions