about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2021-03-09 19:55:35 -0800
committerCamelid <camelidcamel@gmail.com>2021-03-09 20:02:52 -0800
commitb7d91b0ae45698f56eef67cc60abcf2784a69cb5 (patch)
tree78dc82811b47b5dd114684910f14c298834e1a44 /compiler/rustc_codegen_llvm
parent3a5d45f68cadc8fff4fbb557780f92b403b19c19 (diff)
downloadrust-b7d91b0ae45698f56eef67cc60abcf2784a69cb5.tar.gz
rust-b7d91b0ae45698f56eef67cc60abcf2784a69cb5.zip
Remove `masked_crates` from `clean::Crate`
Previously, `masked_crates` existed both on `Cache` and on
`clean::Crate`. During cache population, the `clean::Crate` version was
`take`n and moved to `Cache`.

This change removes the version on `clean::Crate` and instead directly
mutates `Cache.masked_crates` to initialize it. This has the advantage
of avoiding duplication and avoiding unnecessary allocation, as well as
making the flow of information through rustdoc less confusing.

The one downside I see is that `clean::utils::krate()` now uses the side
effect of mutating `DocContext.cache` instead of returning the data
directly, but it already mutated the `Cache` for other things (e.g.,
`deref_trait_did`) so it's not really new behavior. Also,
`clean::utils::krate()` is only called once (and is meant to only be
called once since it performs expensive and potentially destructive
operations) so the mutation shouldn't be an issue.
Diffstat (limited to 'compiler/rustc_codegen_llvm')
0 files changed, 0 insertions, 0 deletions