Skip to content

rustdoc search with space giving "Unexpected +" error #119219

Closed
@Enyium

Description

@Enyium

+ in a URL means space, just like %20. When I paste something with a space in my browser search box (like, e.g., a trailing space; not the omnibar; in Firefox), and search on doc.rust-lang.org, test+ can be seen in the search box on the page, along with the error 'Query parser error: "Unexpected +".' The address bar shows https://doc.rust-lang.org/std/?search=test%2B (literal + is U+002B).

When I manually visit https://doc.rust-lang.org/std/?search=test+, a redirect to https://doc.rust-lang.org/std/?search=test%2B can briefly be seen happening in the address bar (same in Brave browser), whereas manually visiting https://www.google.com/search?q=foo+bar+ works as expected.

The same problem happens on other pages using rustdoc, like https://microsoft.github.io/windows-docs-rs/doc/windows/.

+ should be treated as space - as usual - but it seems something related to rustdoc is erroneously treating it as a literal +.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-searchArea: Rustdoc's search featureT-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