Skip to content

Commit 5e63326

Browse files
committed
rustdoc.d.ts: window.SIDEBAR_ITEMS may exist.
1 parent 38a4dbf commit 5e63326

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: src/librustdoc/html/static/js/main.js

-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ function preLoadCss(cssUrl) {
588588
document.addEventListener("keydown", handleShortcut);
589589

590590
function addSidebarItems() {
591-
// @ts-expect-error
592591
if (!window.SIDEBAR_ITEMS) {
593592
return;
594593
}

Diff for: src/librustdoc/html/static/js/rustdoc.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ declare global {
77
interface Window {
88
/** Make the current theme easy to find */
99
currentTheme: HTMLLinkElement|null;
10+
/** Generated in `render/context.rs` */
11+
SIDEBAR_ITEMS?: { [key: string]: string[] };
1012
/** Used by the popover tooltip code. */
1113
RUSTDOC_TOOLTIP_HOVER_MS: number;
1214
/** Used by the popover tooltip code. */

0 commit comments

Comments
 (0)