SIGN IN SIGN UP
rust-lang / rust UNCLAIMED

Empowering everyone to build reliable and efficient software.

0 0 68 Rust

Auto merge of #118961 - notriddle:notriddle/varconst, r=GuillaumeGomez

rustdoc-search: fix a race condition in search index loading

`var` declare it in the global scope, and `const` does not. It needs to be declared in global scope.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const

> const declarations do not create properties on [globalThis](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) when declared at the top level of a script.

Fixes a regression introduced by https://github.com/rust-lang/rust/pull/118910
B
bors committed
96df4943409564a187894018f15f795426dc2e1f