rustdoc: Get rid of Cache::extern_locations
and calculate the info on-demand
#84588
Labels
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Right now,
extern_locations
is populated like this: https://github.com/rust-lang/rust/blob/d81d7ab203207c4110fbf1919a99345f7e9c1498/src/librustdoc/formats/cache.rs#L158-L171All of these can be computed on-demand with only the CrateNum, TyCtxt, and
extern_html_root_urls
. We should do so to avoid doing more work than necessary (and taking up lots of memory).Mentoring instructions:
src_root
,name
, andlocation
toExternalCrate
, using the same implementation that's currently inCache::populate
.cache.extern_location
to use the functions instead.cache.extern_location
.Originally posted by @jyn514 in #84494 (comment)
The text was updated successfully, but these errors were encountered: