Skip to content

Passing --disable-per-crate-search to rustdoc disables search altogether #66816

Closed
@jyn514

Description

@jyn514

docs.rs ran into this this morning, see rust-lang/docs.rs#497.

This seems to have been caused by #66298, which disabled the search bar by default. The logic to reenable search was a little buggy - getSearchElement() looks for an element with the 'search' id, but that ID is not set when --disable-per-crate-search is enabled.

Steps to replicate:

cat '/// Hello, world!
fn main() {
}' > tmp.rs
rustdoc +nightly -Zunstable-options --disable-per-crate-search tmp.rs
xdg-open doc/tmp/index.html

cc @QuietMisdreavus @GuillaumeGomez

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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