diff options
| author | Michael Howell <michael@notriddle.com> | 2023-07-13 10:53:21 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-09-21 15:16:44 -0700 |
| commit | 2a4c9d07562c42950699609e32e77fbe9ceaa4e9 (patch) | |
| tree | 6201c9342fadb7ad4ac671c96d0c139f72e65070 | |
| parent | 20b93b951aaa75bd32ec1c1c63eac5dbccc35156 (diff) | |
| download | rust-2a4c9d07562c42950699609e32e77fbe9ceaa4e9.tar.gz rust-2a4c9d07562c42950699609e32e77fbe9ceaa4e9.zip | |
Update search-result-impl-disambiguation.goml
| -rw-r--r-- | src/librustdoc/html/static/js/main.js | 4 | ||||
| -rw-r--r-- | tests/rustdoc-gui/search-result-impl-disambiguation.goml | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index aa8fd7162ee..43c4f2b6ff5 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -354,13 +354,13 @@ function preLoadCss(cssUrl) { expandSection(pageId); } } - if (savedHash.startsWith("#impl-")) { + if (savedHash.startsWith("impl-")) { // impl-disambiguated links, used by the search engine // format: impl-X[-for-Y]/method.WHATEVER // turn this into method.WHATEVER[-NUMBER] const splitAt = savedHash.indexOf("/"); if (splitAt !== -1) { - const implId = savedHash.slice(1, splitAt); + const implId = savedHash.slice(0, splitAt); const assocId = savedHash.slice(splitAt + 1); const implElem = document.getElementById(implId); if (implElem && implElem.parentElement.tagName === "SUMMARY" && diff --git a/tests/rustdoc-gui/search-result-impl-disambiguation.goml b/tests/rustdoc-gui/search-result-impl-disambiguation.goml index 1596a3c4c6e..6d12032e891 100644 --- a/tests/rustdoc-gui/search-result-impl-disambiguation.goml +++ b/tests/rustdoc-gui/search-result-impl-disambiguation.goml @@ -2,7 +2,7 @@ // Checks that, if a type has two methods with the same name, they both get // linked correctly. -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // This should link to the inherent impl write: (".search-input", "ZyxwvutMethodDisambiguation -> bool") @@ -22,7 +22,7 @@ assert-document-property: ({ }, ENDS_WITH) assert: "section:target" -goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // This should link to the trait impl write: (".search-input", "ZyxwvutMethodDisambiguation, usize -> usize") |
