Skip to content

Commit cbb40cd

Browse files
authored
Rollup merge of rust-lang#86819 - GuillaumeGomez:cleanup-rustdoc-ids, r=jyn514
Clean up rustdoc IDs I cherry-picked the commit from rust-lang#86178. It adds missing rustdoc IDs (for the HTML) and remove unused ones. cc `@camelid` r? `@jyn514`
2 parents 7e95290 + 8c2a37a commit cbb40cd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/librustdoc/html/markdown.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,10 @@ pub struct IdMap {
13581358

13591359
fn init_id_map() -> FxHashMap<String, usize> {
13601360
let mut map = FxHashMap::default();
1361-
// This is the list of IDs used by rustdoc templates.
1361+
// This is the list of IDs used in Javascript.
1362+
map.insert("help".to_owned(), 1);
1363+
// This is the list of IDs used in HTML generated in Rust (including the ones
1364+
// used in tera template files).
13621365
map.insert("mainThemeStyle".to_owned(), 1);
13631366
map.insert("themeStyle".to_owned(), 1);
13641367
map.insert("theme-picker".to_owned(), 1);
@@ -1375,14 +1378,14 @@ fn init_id_map() -> FxHashMap<String, usize> {
13751378
map.insert("rustdoc-vars".to_owned(), 1);
13761379
map.insert("sidebar-vars".to_owned(), 1);
13771380
map.insert("copy-path".to_owned(), 1);
1378-
map.insert("help".to_owned(), 1);
13791381
map.insert("TOC".to_owned(), 1);
1380-
map.insert("render-detail".to_owned(), 1);
1381-
// This is the list of IDs used by rustdoc sections.
1382+
// This is the list of IDs used by rustdoc sections (but still generated by
1383+
// rustdoc).
13821384
map.insert("fields".to_owned(), 1);
13831385
map.insert("variants".to_owned(), 1);
13841386
map.insert("implementors-list".to_owned(), 1);
13851387
map.insert("synthetic-implementors-list".to_owned(), 1);
1388+
map.insert("foreign-impls".to_owned(), 1);
13861389
map.insert("implementations".to_owned(), 1);
13871390
map.insert("trait-implementations".to_owned(), 1);
13881391
map.insert("synthetic-implementations".to_owned(), 1);
@@ -1393,6 +1396,10 @@ fn init_id_map() -> FxHashMap<String, usize> {
13931396
map.insert("provided-methods".to_owned(), 1);
13941397
map.insert("implementors".to_owned(), 1);
13951398
map.insert("synthetic-implementors".to_owned(), 1);
1399+
map.insert("trait-implementations-list".to_owned(), 1);
1400+
map.insert("synthetic-implementations-list".to_owned(), 1);
1401+
map.insert("blanket-implementations-list".to_owned(), 1);
1402+
map.insert("deref-methods".to_owned(), 1);
13961403
map
13971404
}
13981405

0 commit comments

Comments
 (0)