Closed
Description
Right now, extern_locations
is populated like this: https://github.com/rust-lang/rust/blob/d81d7ab203207c4110fbf1919a99345f7e9c1498/src/librustdoc/formats/cache.rs#L158-L171
All 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:
- Add functions
src_root
,name
, andlocation
toExternalCrate
, using the same implementation that's currently inCache::populate
. - Change all uses of
cache.extern_location
to use the functions instead. - Delete
cache.extern_location
.
Originally posted by @jyn514 in #84494 (comment)
Metadata
Metadata
Assignees
Labels
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Issue: Problems and improvements with respect to memory usage during compilation.Relevant to the rustdoc team, which will review and decide on the PR/issue.