Skip to content

Bump cached from 3.1.1 to 4.0.0 - #21

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/cargo/cached-4.0.0
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/cargo/cached-4.0.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Sep 13, 2026

Copy link
Copy Markdown
Contributor

Bumps cached from 3.1.1 to 4.0.0.

Changelog

Sourced from cached's changelog.

[4.0.0 / cached_proc_macro 3.0.1] - 2026-09-05

Breaking Changes

  • Argument-inference breakage on the six sharded stores' inherent lookup methods (ShardedUnboundCache, ShardedLruCache, ShardedTtlCache, ShardedLruTtlCache, ShardedExpiringCache, ShardedExpiringLruCache): get, remove, remove_entry, delete, contains, and peek are all generic over the looked-up key form Q. cache.get(&k) where k: &K (for example, for k in &keys { cache.get(&k) }) previously compiled through deref coercion. It no longer does: Q unifies to &K first, and the call fails with the trait bound `String: Borrow<&String>` is not satisfied; same for k: &Box<K> and k: &Arc<K>, and the same shape applies to remove, remove_entry, delete, contains, and peek. Migration: drop the extra & (cache.get(k)), or deref explicitly (cache.get(&**boxed)). Single-owner Cached methods (e.g. LruCache::cache_get) are unchanged.
  • ShardHasher<K>'s key parameter is relaxed to ShardHasher<K: ?Sized>. Existing impls compile unchanged, since this only widens what the trait accepts. But H: ShardHasher<K> no longer implies K: Sized at a use site, which can shift inference in rare downstream generic code.
  • Shard routing no longer consults BuildHasher::hash_one. The blanket ShardHasher impl for a BuildHasher and every store's borrowed-key routing build a Hasher with build_hasher(), hash the key and finish it, and DefaultShardHasher's hash_one override was removed so it uses the provided default too. An overridden hash_one is no longer consulted for routing, and the upper-32-bit distribution contract for a custom hasher applies to the Hasher returned by build_hasher(). This matters for a BuildHasher whose hash_one dispatches on the static type of its argument (ahash::RandomState does, on any nightly compiler): an owned newtype key and its borrowed primitive form would otherwise route to different shards. Deliberate tradeoff: ShardedUnboundCache, ShardedTtlCache, and ShardedExpiringCache back their shards with HashMap<_, _, DefaultShardHasher> and std's HashMap probes via BuildHasher::hash_one, so dropping the override means those three stores take ahash's unspecialized path on a nightly build. Taken for correctness; the cost is nightly-only.

Added

  • cached::claim::{ClaimRegistry, Claim}: a single-flight claim on a key, for collapsing concurrent refreshes of one key onto a single caller. ClaimRegistry::claim(key) returns Some(Claim<K>) to the first caller and None to every later caller until that Claim is dropped; the key is released from Drop, so completion, a panic, and cancellation (an aborted async task) all release it, unlike a hand-rolled guard released at the end of the body. This is not background refresh: the registry spawns nothing and awaits nothing, and spawning the refresh stays with the caller, same as today. Additive, ungated (no new dependency, no feature flag), and reachable via cached::claim:: or cached::prelude, not the crate root, to keep Claim and ClaimRegistry out of rustc's nearest-match suggestions for mistyped imports (design/0053). Debug for ClaimRegistry<K> requires K: Debug + Clone: it copies the key set out from under the registry mutex and formats after releasing it, so no user Debug code and no writer lock is held while the registry is locked. ClaimRegistry::new already requires K: Clone, so this only constrains generic code that names the type without building one.
  • CacheSetMaxSize and ConcurrentCacheSetMaxSize traits, reaching set_max_size / try_set_max_size from generic code holding a T: CacheSetMaxSize (or ConcurrentCacheSetMaxSize) bound instead of a concrete store type. No new capability: both methods already existed as inherent-only methods and already evicted eagerly on shrink, firing

... (truncated)

Commits
  • de90246 release 4.0.0 / cached_proc_macro 3.0.1 (#327)
  • 72b74e5 ci: guard the generated clone's syntax context on nightly (#326)
  • 39ac4db keep the generated clone inside the macro expansion so nightly clippy's clone...
  • 9a556d8 Capability traits, and borrowed keys on the sharded lookups (#324)
  • 23ecae4 add ClaimRegistry: a single-flight guard for background refreshes (#323)
  • d0c26a9 correct the extreme-ttl doc claims about the sharded stores (#322)
  • a9a192f pin the cargo-readme version CI installs (#321)
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [cached](https://github.com/jaemk/cached) from 3.1.1 to 4.0.0.
- [Release notes](https://github.com/jaemk/cached/releases)
- [Changelog](https://github.com/jaemk/cached/blob/master/CHANGELOG.md)
- [Commits](jaemk/cached@v3.1.1...v4.0.0)

---
updated-dependencies:
- dependency-name: cached
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants