diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 31e06cb1a045f..1d50afe2821ac 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1042,7 +1042,7 @@ themePicker.onblur = handleThemeButtonsBlur;
all_sources.sort();
let mut w = try_err!(File::create(&dst), &dst);
try_err!(writeln!(&mut w,
- "var N = null;var sourcesIndex = {{}};\n{}",
+ "var N = null;var sourcesIndex = {{}};\n{}\ncreateSourceSidebar();",
all_sources.join("\n")),
&dst);
}
diff --git a/src/librustdoc/html/static/source-script.js b/src/librustdoc/html/static/source-script.js
index 0affe1c6812f5..c5d6fa16f550e 100644
--- a/src/librustdoc/html/static/source-script.js
+++ b/src/librustdoc/html/static/source-script.js
@@ -137,5 +137,3 @@ function createSourceSidebar() {
main.insertBefore(sidebar, main.firstChild);
}
-
-createSourceSidebar();