Skip to content

Commit 2370e3b

Browse files
committed
Get rid of unneeded aliases field
1 parent 5f92951 commit 2370e3b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustdoc/formats/cache.rs

-4
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ crate struct Cache {
120120
// when gathering trait documentation on a type, hold impls here while
121121
// folding and add them to the cache later on if we find the trait.
122122
orphan_trait_impls: Vec<(DefId, FxHashSet<DefId>, Impl)>,
123-
124-
/// Aliases added through `#[doc(alias = "...")]`. Since a few items can have the same alias,
125-
/// we need the alias element to have an array of items.
126-
crate aliases: BTreeMap<String, Vec<usize>>,
127123
}
128124

129125
/// This struct is used to wrap the `cache` and `tcx` in order to run `DocFolder`.

src/librustdoc/html/render/cache.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
8787
}
8888
}
8989

90-
let Cache { ref mut search_index, ref paths, ref mut aliases, .. } = *cache;
90+
let Cache { ref mut search_index, ref paths, .. } = *cache;
91+
92+
// Aliases added through `#[doc(alias = "...")]`. Since a few items can have the same alias,
93+
// we need the alias element to have an array of items.
94+
let mut aliases: BTreeMap<String, Vec<usize>> = BTreeMap::new();
9195

9296
// Sort search index items. This improves the compressibility of the search index.
9397
search_index.sort_unstable_by(|k1, k2| {
@@ -210,7 +214,7 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
210214
doc: crate_doc,
211215
items: crate_items,
212216
paths: crate_paths,
213-
aliases,
217+
aliases: &aliases,
214218
})
215219
.expect("failed serde conversion")
216220
// All these `replace` calls are because we have to go through JS string for JSON content.

0 commit comments

Comments
 (0)