about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/rustdoc.d.ts
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-06-17 23:19:33 +0200
committerGitHub <noreply@github.com>2025-06-17 23:19:33 +0200
commit0772ee7f8b2b4acac1f6e82b0f65a78b38817502 (patch)
tree07e18ed42de3ccfc561e1b3402872b52acad4222 /src/librustdoc/html/static/js/rustdoc.d.ts
parent17ab49a94a9dd34c54852778310277a7a13cc006 (diff)
parent00c104225fad5d3eb27dc37719d9b6c26844c389 (diff)
downloadrust-0772ee7f8b2b4acac1f6e82b0f65a78b38817502.tar.gz
rust-0772ee7f8b2b4acac1f6e82b0f65a78b38817502.zip
Rollup merge of #142100 - lolbinarycat:rustdoc-srcIndex-138467, r=GuillaumeGomez
rustdoc: make srcIndex no longer a global variable

this is one-time initialization data, it can just
be a function parameter.

while we're doing that, we can more the json parsing into the function and save a few extra bytes of storage for free, at least in the case of multiple crates in a doc bundle.

fixes https://github.com/rust-lang/rust/issues/138467
Diffstat (limited to 'src/librustdoc/html/static/js/rustdoc.d.ts')
-rw-r--r--src/librustdoc/html/static/js/rustdoc.d.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/librustdoc/html/static/js/rustdoc.d.ts b/src/librustdoc/html/static/js/rustdoc.d.ts
index 0d2e19e019f..6af16441de8 100644
--- a/src/librustdoc/html/static/js/rustdoc.d.ts
+++ b/src/librustdoc/html/static/js/rustdoc.d.ts
@@ -4,8 +4,6 @@
 
 /* eslint-disable */
 declare global {
-    /** Map from crate name to directory structure, for source view */
-    declare var srcIndex: Map<string, rustdoc.Dir>;
     /** Defined and documented in `storage.js` */
     declare function nonnull(x: T|null, msg: string|undefined);
     /** Defined and documented in `storage.js` */
@@ -64,7 +62,7 @@ declare global {
          * create's the sidebar in source code view.
          * called in generated `src-files.js`.
          */
-        createSrcSidebar?: function(),
+        createSrcSidebar?: function(string),
         /**
          * Set up event listeners for a scraped source example.
          */
@@ -129,7 +127,7 @@ declare namespace rustdoc {
 
     /**
      * A single parsed "atom" in a search query. For example,
-     * 
+     *
      *     std::fmt::Formatter, Write -> Result<()>
      *     ┏━━━━━━━━━━━━━━━━━━  ┌────    ┏━━━━━┅┅┅┅┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
      *     ┃                    │        ┗ QueryElement {        ┊