1
Fork 0

rustdoc: Remove Crate.src and instead compute it on-demand

It is only used in one place; `src` was about a third of `Crate`'s total
size; `Crate` is frequently moved by-value; and `src` can be easily
computed on-demand.
This commit is contained in:
Noah Lev 2021-10-28 20:48:48 -07:00
parent 47b0059dba
commit 85f8ae8ec4
3 changed files with 8 additions and 5 deletions

View file

@ -57,7 +57,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
}
let local_crate = ExternalCrate { crate_num: LOCAL_CRATE };
let src = local_crate.src(cx.tcx);
let name = local_crate.name(cx.tcx);
let primitives = local_crate.primitives(cx.tcx);
let keywords = local_crate.keywords(cx.tcx);
@ -81,7 +80,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
Crate {
name,
src,
module,
externs,
primitives,