-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #82960 - camelid:masked_crates, r=jyn514
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. Follow-up to #82018 (comment). cc `@jyn514`
- Loading branch information
Showing
3 changed files
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters