Skip to content

Commit 6c22ef5

Browse files
committed
typecheck window.NOTABLE_TRAITS
1 parent 4b73a7e commit 6c22ef5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/librustdoc/html/static/js/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,11 +1327,9 @@ function preLoadCss(cssUrl) {
13271327
*/
13281328
function showTooltip(e) {
13291329
const notable_ty = e.getAttribute("data-notable-ty");
1330-
// @ts-expect-error
13311330
if (!window.NOTABLE_TRAITS && notable_ty) {
13321331
const data = document.getElementById("notable-traits-data");
13331332
if (data) {
1334-
// @ts-expect-error
13351333
window.NOTABLE_TRAITS = JSON.parse(data.innerText);
13361334
} else {
13371335
throw new Error("showTooltip() called with notable without any notable traits!");

src/librustdoc/html/static/js/rustdoc.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ declare global {
2828
currentTheme: HTMLLinkElement|null;
2929
/** Generated in `render/context.rs` */
3030
SIDEBAR_ITEMS?: { [key: string]: string[] };
31+
/** Notable trait data */
32+
NOTABLE_TRAITS?: { [key: string]: string };
3133
/** Used by the popover tooltip code. */
3234
RUSTDOC_TOOLTIP_HOVER_MS: number;
3335
/** Used by the popover tooltip code. */

0 commit comments

Comments
 (0)