1
Fork 0

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

It is not as large as `Crate.src` was, but it's still 8 bytes, and
`clean::Crate` is moved by-value a lot.
This commit is contained in:
Noah Lev 2021-10-28 20:55:02 -07:00
parent 85f8ae8ec4
commit ebe9a11f71
6 changed files with 16 additions and 14 deletions

View file

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