about summary refs log tree commit diff
path: root/src/librustdoc/html/render/write_shared.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-09-15 13:37:29 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-09-17 17:32:57 +0200
commitcd3f4da244578a2ab4d17d10016c61b9191b21e4 (patch)
treec0f129281b79da59a8a64079e6e2da4caf60eb72 /src/librustdoc/html/render/write_shared.rs
parente0c38af27cb5f6f961809601b717d6afc3b190ee (diff)
downloadrust-cd3f4da244578a2ab4d17d10016c61b9191b21e4.tar.gz
rust-cd3f4da244578a2ab4d17d10016c61b9191b21e4.zip
Add rustdoc version into the help popup
Diffstat (limited to 'src/librustdoc/html/render/write_shared.rs')
-rw-r--r--src/librustdoc/html/render/write_shared.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs
index 1dd0917699b..c1a83ad5820 100644
--- a/src/librustdoc/html/render/write_shared.rs
+++ b/src/librustdoc/html/render/write_shared.rs
@@ -268,10 +268,18 @@ pub(super) fn write_shared(
     // Maybe we can change the representation to move this out of main.js?
     write_minify(
         "main.js",
-        static_files::MAIN_JS.replace(
-            "/* INSERT THEMES HERE */",
-            &format!(" = {}", serde_json::to_string(&themes).unwrap()),
-        ),
+        static_files::MAIN_JS
+            .replace(
+                "/* INSERT THEMES HERE */",
+                &format!(" = {}", serde_json::to_string(&themes).unwrap()),
+            )
+            .replace(
+                "/* INSERT RUSTDOC_VERSION HERE */",
+                &format!(
+                    "rustdoc {}",
+                    rustc_interface::util::version_str().unwrap_or("unknown version")
+                ),
+            ),
         cx,
         options,
     )?;