Skip to content

Commit 616dc5d

Browse files
committed
rustdoc: Don't add a resource-suffix to files that can't be shared across crates
rust-lang/docs.rs#1312
1 parent bbf07c0 commit 616dc5d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustdoc/html/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ crate fn render<T: Print, S: Print>(
5858
{style_files}\
5959
<script id=\"default-settings\"{default_settings}></script>\
6060
<script src=\"{static_root_path}storage{suffix}.js\"></script>\
61-
<script src=\"{root_path}crates{suffix}.js\"></script>\
61+
<script src=\"{root_path}crates.js\"></script>\
6262
<noscript><link rel=\"stylesheet\" href=\"{static_root_path}noscript{suffix}.css\"></noscript>\
6363
{css_extension}\
6464
{favicon}\
@@ -114,7 +114,7 @@ crate fn render<T: Print, S: Print>(
114114
<section class=\"footer\"></section>\
115115
{after_content}\
116116
<div id=\"rustdoc-vars\" data-root-path=\"{root_path}\" data-current-crate=\"{krate}\" \
117-
data-search-js=\"{root_path}search-index{suffix}.js\"></div>
117+
data-search-js=\"{root_path}search-index.js\"></div>
118118
<script src=\"{static_root_path}main{suffix}.js\"></script>\
119119
{extra_scripts}\
120120
</body>\

src/librustdoc/html/render/write_shared.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ themePicker.onblur = handleThemeButtonsBlur;
361361
}
362362
}
363363

364-
let dst = cx.dst.join(&format!("source-files{}.js", cx.shared.resource_suffix));
364+
let dst = cx.dst.join("source-files.js");
365365
let (mut all_sources, _krates) =
366366
try_err!(collect(&dst, &krate.name.as_str(), "sourcesIndex"), &dst);
367367
all_sources.push(format!(
@@ -378,7 +378,7 @@ themePicker.onblur = handleThemeButtonsBlur;
378378
}
379379

380380
// Update the search index and crate list.
381-
let dst = cx.dst.join(&format!("search-index{}.js", cx.shared.resource_suffix));
381+
let dst = cx.dst.join("search-index.js");
382382
let (mut all_indexes, mut krates) = try_err!(collect_json(&dst, &krate.name.as_str()), &dst);
383383
all_indexes.push(search_index);
384384
krates.push(krate.name.to_string());
@@ -394,7 +394,7 @@ themePicker.onblur = handleThemeButtonsBlur;
394394
cx.shared.fs.write(&dst, &v)?;
395395
}
396396

397-
let crate_list_dst = cx.dst.join(&format!("crates{}.js", cx.shared.resource_suffix));
397+
let crate_list_dst = cx.dst.join("crates.js");
398398
let crate_list =
399399
format!("window.ALL_CRATES = [{}];", krates.iter().map(|k| format!("\"{}\"", k)).join(","));
400400
cx.shared.fs.write(&crate_list_dst, &crate_list)?;

src/librustdoc/html/static/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2970,7 +2970,7 @@ function defocusSearchBar() {
29702970
}
29712971
}
29722972

2973-
// `crates{version}.js` should always be loaded before this script, so we can use it safely.
2973+
// `crates.js` should always be loaded before this script, so we can use it safely.
29742974
addSearchOptions(window.ALL_CRATES);
29752975
addSidebarCrates(window.ALL_CRATES);
29762976

0 commit comments

Comments
 (0)