Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jyn514 opened this issue Nov 27, 2019 · 1 comment · Fixed by #76052
Closed

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

jyn514 opened this issue Nov 27, 2019 · 1 comment · Fixed by #76052
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Nov 27, 2019

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

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 27, 2019
@GuillaumeGomez
Copy link
Member

I'll try to take a look tomorrow.

@jyn514 jyn514 added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Aug 26, 2020
aszenz added a commit to aszenz/rust that referenced this issue Aug 29, 2020
Passing --disable-per-crate-search removes the create search
inputs so moved code around so that the search input is enabled
first before the function returns
aszenz added a commit to aszenz/rust that referenced this issue Aug 29, 2020
matklad added a commit to matklad/rust that referenced this issue Aug 31, 2020
…ribute_before_return, r=GuillaumeGomez

rust-langGH-66816:  Remove disable attr before return

Passing --disable-per-crate-search removes the create search inputs so moved code around so that the search input is enabled
first before the function returns.

Fixes rust-lang#66816
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 31, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#75969 (Switch to intra-doc links in core/src/{convert,iter}/mod.rs)
 - rust-lang#76023 (Liballoc extend use intra doc link)
 - rust-lang#76033 (Add missing hyphen)
 - rust-lang#76052 (rust-langGH-66816:  Remove disable attr before return)
 - rust-lang#76055 (Keep doc standard for Vec DrainFilter)
 - rust-lang#76058 (Use assertions on Vec doc)
 - rust-lang#76069 (Use explicit intra-doc link in path for Vec resize)
 - rust-lang#76117 (Update README.md)
 - rust-lang#76134 (Update MinGW instructions to include ninja)

Failed merges:

r? @ghost
@bors bors closed this as completed in 300d7f6 Aug 31, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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