Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5dd54fd
lint/ctypes: ext. abi fn-ptr in internal abi fn
davidtwco Mar 1, 2023
c1dcf26
abi: avoid ice for non-ffi-safe fn ptrs
davidtwco Mar 1, 2023
92ae35f
lint/ctypes: multiple external fn-ptrs in ty
davidtwco Mar 2, 2023
3e7ca3e
lint/ctypes: check other types for ext. fn-ptr ty
davidtwco Mar 2, 2023
1a7132d
rustdoc-search: fix incorrect doc comment
notriddle Apr 14, 2023
4c11822
rustdoc: restructure type search engine to pick-and-use IDs
notriddle Apr 15, 2023
1ece1ea
Stablize raw-dylib, link_ordinal and -Cdlltool
dpaoliello Mar 27, 2023
b6f81e0
rustdoc-search: give longer notification for type corrections
notriddle Apr 19, 2023
e0a7462
rustdoc-search: clean up `checkIfInGenerics` call at end of `checkType`
notriddle Apr 20, 2023
7529d87
rustdoc-search: make type name correction choice deterministic
notriddle Apr 20, 2023
395840c
rustdoc-search: use more descriptive "x not found; y instead" message
notriddle Apr 20, 2023
d5e7ac5
avoid duplicating TLS state between test std and realstd
RalfJung Apr 28, 2023
ed468ee
Encode def span for foreign RPITITs
compiler-errors Apr 30, 2023
bc68de9
remove pointless `FIXME` in `bootstrap::download`
onur-ozkan May 1, 2023
b3bc5f8
Rollup merge of #108611 - davidtwco:issue-94223-external-abi-fn-ptr-i…
Dylan-DPC May 2, 2023
108a26c
Rollup merge of #109677 - dpaoliello:rawdylib, r=michaelwoerister,wes…
Dylan-DPC May 2, 2023
c9f03bf
Rollup merge of #110371 - notriddle:notriddle/search-corrections, r=G…
Dylan-DPC May 2, 2023
6b3cfaa
Rollup merge of #110946 - RalfJung:tls-realstd, r=m-ou-se
Dylan-DPC May 2, 2023
c6ba892
Rollup merge of #111039 - compiler-errors:foreign-span-rpitit, r=tmiasko
Dylan-DPC May 2, 2023
5c7cd00
Rollup merge of #111069 - ozkanonur:remove-pointless-fixme, r=albertl…
Dylan-DPC May 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustdoc-search: give longer notification for type corrections
  • Loading branch information
notriddle committed Apr 19, 2023
commit b6f81e04347d9dbd29e59e7dbca3f9289ddb2fe3
9 changes: 7 additions & 2 deletions src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -1996,8 +1996,13 @@ function initSearch(rawSearchIndex) {
}

if (results.query.correction !== null) {
output += "<h3 class=\"search-corrections\">Showing results for " +
`"${results.query.correction}".</h3>`;
const orig = results.query.returned.length > 0
? results.query.returned[0].name
: results.query.elems[0].name;
output += "<h3 class=\"search-corrections\">" +
`Type "${orig}" not found. ` +
"Showing results for " +
`"${results.query.correction}" instead.</h3>`;
}

const resultsElem = document.createElement("div");
Expand Down
6 changes: 3 additions & 3 deletions tests/rustdoc-gui/search-corrections.goml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ assert-css: (".search-corrections", {
})
assert-text: (
".search-corrections",
"Showing results for \"notablestructwithlongname\"."
"Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead."
)

// Corrections do get shown on the "In Return Type" tab.
Expand All @@ -33,7 +33,7 @@ assert-css: (".search-corrections", {
})
assert-text: (
".search-corrections",
"Showing results for \"notablestructwithlongname\"."
"Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead."
)

// Now, explicit return values
Expand All @@ -50,5 +50,5 @@ assert-css: (".search-corrections", {
})
assert-text: (
".search-corrections",
"Showing results for \"notablestructwithlongname\"."
"Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead."
)