]> git.proxmox.com Git - cargo.git/commitdiff
Auto merge of #10482 - arlosi:refactor_load, r=Eh2406
authorbors <bors@rust-lang.org>
Thu, 17 Mar 2022 21:43:09 +0000 (21:43 +0000)
committerbors <bors@rust-lang.org>
Thu, 17 Mar 2022 21:43:09 +0000 (21:43 +0000)
Refactor RegistryData::load to handle management of the index cache

Enables registry implementations to signal if the cache is valid on a per-request basis.

Fixes a bug introduced by #10064 that caused Cargo not to update for several cases in a release build because it believed the index cache to be valid when it was not. The issue only occurred in release builds because debug builds verify that the cache contents is correct (by refreshing it).

Previously `current_version` was called by the index to determine whether the cache was valid. In the new model, `RegistryData::load` is passed the current version of the cache and returns an enum to indicate the status of the cached data.

r? `@eh2406`
cc `@ehuss`


Trivial merge