diff options
| author | Camelid <camelidcamel@gmail.com> | 2021-03-09 19:55:35 -0800 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2021-03-09 20:02:52 -0800 |
| commit | b7d91b0ae45698f56eef67cc60abcf2784a69cb5 (patch) | |
| tree | 78dc82811b47b5dd114684910f14c298834e1a44 /compiler/rustc_codegen_llvm | |
| parent | 3a5d45f68cadc8fff4fbb557780f92b403b19c19 (diff) | |
| download | rust-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
