Skip to content

Rollup of 9 pull requests #142794

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jun 21, 2025
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
32cb8f1
Add trim_prefix and trim_suffix for slice and str.
deven Jun 11, 2025
6ca4639
Fix random failure when JS code is executed when the whole file was n…
GuillaumeGomez Jun 14, 2025
2eccf18
Add comment to prevent having code other than `initSearch` at the end…
GuillaumeGomez Jun 16, 2025
815f0b7
better template for repr attributes
jdonszelmann Jun 12, 2025
7f49de2
fixup missing docs in attr parsing
jdonszelmann Jun 12, 2025
496cbe1
mbe: Move `transcribe_metavar_expr` directly after `transcribe`
tgross35 Jun 19, 2025
67a9fb2
mbe: Refactor transcription
tgross35 Jun 19, 2025
07b9bb1
Extract Translator struct
camsteffen Jun 19, 2025
316f63b
Rename SilentEmitter -> FatalOnlyEmitter
camsteffen Jun 17, 2025
3388d83
Extract SilentEmitter
camsteffen Jun 19, 2025
aab941f
rustdoc: Remove `FormatRenderer::cache`
aDotInTheVoid Jun 19, 2025
e159cf0
Add regression test
oli-obk Jun 16, 2025
cfc22cf
Ensure copy* intrinsics also perform the static self-init checks
oli-obk Jun 16, 2025
de0fd27
cold
jdonszelmann Jun 12, 2025
b9107a8
expected word diagnostic test
jdonszelmann Jun 12, 2025
851fbcb
Rollup merge of #142331 - deven:trim_prefix_suffix, r=Amanieu
tgross35 Jun 20, 2025
f0374dc
Rollup merge of #142491 - jdonszelmann:cold, r=oli-obk
tgross35 Jun 20, 2025
d2a00eb
Rollup merge of #142494 - jdonszelmann:missing-attr-parsing-docs, r=o…
tgross35 Jun 20, 2025
1e2ac53
Rollup merge of #142495 - jdonszelmann:better-repr-template, r=oli-obk
tgross35 Jun 20, 2025
bad4bf5
Rollup merge of #142497 - GuillaumeGomez:fix-random-search-failure, r…
tgross35 Jun 20, 2025
5d6ecf5
Rollup merge of #142575 - oli-obk:sneaky-self-init, r=RalfJung
tgross35 Jun 20, 2025
38600a6
Rollup merge of #142650 - camsteffen:refactor-translator, r=petrochenkov
tgross35 Jun 20, 2025
e7a2c40
Rollup merge of #142713 - tgross35:mbe-transcribe-refactor, r=petroch…
tgross35 Jun 20, 2025
61f4918
Rollup merge of #142755 - aDotInTheVoid:rdj-shattrs, r=GuillaumeGomez
tgross35 Jun 20, 2025
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
Fix random failure when JS code is executed when the whole file was n…
…ot read yet
  • Loading branch information
GuillaumeGomez committed Jun 14, 2025
commit 6ca4639d6a0131097bb10e30b516abc2632cf32e
74 changes: 37 additions & 37 deletions src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5393,43 +5393,6 @@ function updateCrate(ev) {
search(true);
}

// @ts-expect-error
function initSearch(searchIndx) {
rawSearchIndex = searchIndx;
if (typeof window !== "undefined") {
// @ts-expect-error
docSearch = new DocSearch(rawSearchIndex, ROOT_PATH, searchState);
registerSearchEvents();
// If there's a search term in the URL, execute the search now.
if (window.searchState.getQueryStringParams().search) {
search();
}
} else if (typeof exports !== "undefined") {
// @ts-expect-error
docSearch = new DocSearch(rawSearchIndex, ROOT_PATH, searchState);
exports.docSearch = docSearch;
exports.parseQuery = DocSearch.parseQuery;
}
}

if (typeof exports !== "undefined") {
exports.initSearch = initSearch;
}

if (typeof window !== "undefined") {
// @ts-expect-error
window.initSearch = initSearch;
// @ts-expect-error
if (window.searchIndex !== undefined) {
// @ts-expect-error
initSearch(window.searchIndex);
}
} else {
// Running in Node, not a browser. Run initSearch just to produce the
// exports.
initSearch(new Map());
}

// Parts of this code are based on Lucene, which is licensed under the
// Apache/2.0 license.
// More information found here:
Expand Down Expand Up @@ -5908,3 +5871,40 @@ Lev1TParametricDescription.prototype.toStates3 = /*3 bits per value */ new Int32
Lev1TParametricDescription.prototype.offsetIncrs3 = /*2 bits per value */ new Int32Array([
0xa0fc0000,0x5555ba08,0x55555555,
]);

// @ts-expect-error
function initSearch(searchIndx) {
rawSearchIndex = searchIndx;
if (typeof window !== "undefined") {
// @ts-expect-error
docSearch = new DocSearch(rawSearchIndex, ROOT_PATH, searchState);
registerSearchEvents();
// If there's a search term in the URL, execute the search now.
if (window.searchState.getQueryStringParams().search) {
search();
}
} else if (typeof exports !== "undefined") {
// @ts-expect-error
docSearch = new DocSearch(rawSearchIndex, ROOT_PATH, searchState);
exports.docSearch = docSearch;
exports.parseQuery = DocSearch.parseQuery;
}
}

if (typeof exports !== "undefined") {
exports.initSearch = initSearch;
}

if (typeof window !== "undefined") {
// @ts-expect-error
window.initSearch = initSearch;
// @ts-expect-error
if (window.searchIndex !== undefined) {
// @ts-expect-error
initSearch(window.searchIndex);
}
} else {
// Running in Node, not a browser. Run initSearch just to produce the
// exports.
initSearch(new Map());
}
Loading