Fix bug when rustdoc "go to only result" setting is not working as expected"#158308
Merged
rust-bors[bot] merged 1 commit intoJun 25, 2026
Merged
Conversation
Collaborator
|
Some changes occurred in HTML/CSS/JS. |
GuillaumeGomez
commented
Jun 23, 2026
| go-to: "file://" + |DOC_PATH| + "/lib2/index.html" | ||
| // We enter it into the search. | ||
| click: "#search-button" | ||
| wait-for: "#alternative-display .search-input" |
Member
Author
There was a problem hiding this comment.
I'm surprised it worked before to directly write into the search input even if it's not displayed. It triggered a bug when I wrote Whitespace into it: it only had pace, the beginning was removed. I think it's because the item gets moved in-between and if there are few enough letters, it works, but it's only by change.
GuillaumeGomez
commented
Jun 23, 2026
| write-into: (".search-input", "HasALongTraitWithParams") | ||
| wait-for-document-property: {"title": "HasALongTraitWithParams in lib2 - Rust"} | ||
| assert-window-property: ({"location": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH) | ||
| assert-window-property: ({"location"."pathname": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH) |
Member
Author
There was a problem hiding this comment.
I have no clue how this could have work before since window.location is indeed an object. Gonna investigate on browser-ui-test side.
Member
Author
There was a problem hiding this comment.
e2cad95 to
2262b8e
Compare
GuillaumeGomez
commented
Jun 23, 2026
| go-to: "file://" + |DOC_PATH| + "/lib2/index.html" | ||
| show-text: true | ||
|
|
||
| // The setting should be disabled. |
Member
Author
There was a problem hiding this comment.
To confirm this test works, run it without the fix. It should fail. :)
Contributor
|
@bors r+ |
Contributor
notriddle
approved these changes
Jun 24, 2026
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…, r=notriddle Fix bug when rustdoc "go to only result" setting is not working as expected" Can be reproduced as follows on `std` docs: * Disable the `Directly go to item in search if there is only one result` setting * Search for "var" (without the quotes) * Enable the `Directly go to item in search if there is only one result` setting * Reload the page * It now goes to another page although there are more than one result. Thanks @poliorcetics for the detailed steps. :) The problem is that, we don't necessarily create the tabs in one particular order and if **any** tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two. cc @lolbinarycat r? @notriddle
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…, r=notriddle Fix bug when rustdoc "go to only result" setting is not working as expected" Can be reproduced as follows on `std` docs: * Disable the `Directly go to item in search if there is only one result` setting * Search for "var" (without the quotes) * Enable the `Directly go to item in search if there is only one result` setting * Reload the page * It now goes to another page although there are more than one result. Thanks @poliorcetics for the detailed steps. :) The problem is that, we don't necessarily create the tabs in one particular order and if **any** tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two. cc @lolbinarycat r? @notriddle
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…, r=notriddle Fix bug when rustdoc "go to only result" setting is not working as expected" Can be reproduced as follows on `std` docs: * Disable the `Directly go to item in search if there is only one result` setting * Search for "var" (without the quotes) * Enable the `Directly go to item in search if there is only one result` setting * Reload the page * It now goes to another page although there are more than one result. Thanks @poliorcetics for the detailed steps. :) The problem is that, we don't necessarily create the tabs in one particular order and if **any** tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two. cc @lolbinarycat r? @notriddle
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158294 (Use .drectve for MSVC DLL exports) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound) Failed merges: - #155535 (export symbols: support macos/windows(32/64))
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…, r=notriddle Fix bug when rustdoc "go to only result" setting is not working as expected" Can be reproduced as follows on `std` docs: * Disable the `Directly go to item in search if there is only one result` setting * Search for "var" (without the quotes) * Enable the `Directly go to item in search if there is only one result` setting * Reload the page * It now goes to another page although there are more than one result. Thanks @poliorcetics for the detailed steps. :) The problem is that, we don't necessarily create the tabs in one particular order and if **any** tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two. cc @lolbinarycat r? @notriddle
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…, r=notriddle Fix bug when rustdoc "go to only result" setting is not working as expected" Can be reproduced as follows on `std` docs: * Disable the `Directly go to item in search if there is only one result` setting * Search for "var" (without the quotes) * Enable the `Directly go to item in search if there is only one result` setting * Reload the page * It now goes to another page although there are more than one result. Thanks @poliorcetics for the detailed steps. :) The problem is that, we don't necessarily create the tabs in one particular order and if **any** tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two. cc @lolbinarycat r? @notriddle
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 16 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound) Failed merges: - #158355 (Fixup the refactoring errors in #156246)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
…uwer Rollup of 15 pull requests Successful merges: - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158390 (Fix: auto trait, const trait bound)
rust-timer
added a commit
that referenced
this pull request
Jun 25, 2026
Rollup merge of #158308 - GuillaumeGomez:fix-only-result-bug, r=notriddle Fix bug when rustdoc "go to only result" setting is not working as expected" Can be reproduced as follows on `std` docs: * Disable the `Directly go to item in search if there is only one result` setting * Search for "var" (without the quotes) * Enable the `Directly go to item in search if there is only one result` setting * Reload the page * It now goes to another page although there are more than one result. Thanks @poliorcetics for the detailed steps. :) The problem is that, we don't necessarily create the tabs in one particular order and if **any** tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two. cc @lolbinarycat r? @notriddle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Can be reproduced as follows on
stddocs:Directly go to item in search if there is only one resultsettingDirectly go to item in search if there is only one resultsettingThanks @poliorcetics for the detailed steps. :)
The problem is that, we don't necessarily create the tabs in one particular order and if any tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two.
cc @lolbinarycat
r? @notriddle