Skip to content

fix: clear Clone error for #[cached] return types, async_core docsrs badges, doc and spec corrections - #296

Merged
jaemk merged 1 commit into
masterfrom
260725.pre-3.0-review-fixes
Jul 25, 2026
Merged

fix: clear Clone error for #[cached] return types, async_core docsrs badges, doc and spec corrections#296
jaemk merged 1 commit into
masterfrom
260725.pre-3.0-review-fixes

Conversation

@jaemk

@jaemk jaemk commented Jul 25, 2026

Copy link
Copy Markdown
Owner
  • Emit a Clone-bound compile error spanned at the return type when a #[cached] function's return type is not Clone, ahead of the opaque errors from the generated internals. The assertion targets the cached value type (inner T of Result/Option, Return<T> under with_cached_flag). Trybuild tests cover the plain and with_cached_flag negative cases plus a generic-function positive case.
  • Add the missing doc(cfg(feature = "async_core")) badges on the CachedGetOrSetAsync / ConcurrentCachedAsync impls for the in-memory and sharded stores and HashMap.
  • Correct the changelog and specs/store-lru.md claim that UnboundCache has no retain (it shipped in feat: sharded peek, builder new(), ext alias parity, concurrent cache_try_get_or_set_with, retain on map stores #294); document its semantics (predicate filter, fires on_evict, no eviction counter).
  • Migration guides: fix the cache_peek_with_expiry_status sibling name, reword the rc-era no-arg builder note, add human-guide sections for CacheTtl/CacheEvict removal from concurrent stores and the redis empty-prefix InvalidValue rejection.
  • Specs: add LRU-5/TTL-5/EXPIRE-6 covering iter_order/value_order/CacheValue; mark design 0020 Declined in the index.
  • Document the lookup-key difference between the trait families (&Q where K: Borrow<Q> on Cached vs &K on ConcurrentCached); README regenerated.

…ocsrs badges, doc and spec corrections

- `#[cached]` on a non-`Clone` return type now emits a `Clone`-bound error spanned
  at the return type (a compile-time assertion on the cached value type, including
  `Return<T>` under `with_cached_flag`), ahead of the opaque errors from the
  generated internals. Trybuild tests cover the plain and `with_cached_flag`
  negative cases plus a generic-function positive case.
- add the missing `doc(cfg(feature = "async_core"))` badges on the
  `CachedGetOrSetAsync` / `ConcurrentCachedAsync` impls for the in-memory and
  sharded stores and `HashMap`, so docs.rs marks them feature-gated.
- correct the changelog and `specs/store-lru.md` claim that `UnboundCache` has no
  `retain` (it shipped in #294); document the `UnboundCache` semantics (predicate
  filter, fires `on_evict`, no eviction counter).
- migration guides: fix the `cache_peek_with_expiry_status` sibling name, reword
  the rc-era no-arg builder note, and add human-guide sections for
  `CacheTtl`/`CacheEvict` removal from concurrent stores and the redis
  empty-prefix `InvalidValue` rejection.
- specs: add LRU-5/TTL-5/EXPIRE-6 covering `iter_order`/`value_order`/`CacheValue`;
  mark design 0020 Declined in the index.
- document the lookup-key difference between the trait families
  (`&Q where K: Borrow<Q>` on `Cached` vs `&K` on `ConcurrentCached`) in the
  lib.rs comparison docs; README regenerated.
@jaemk
jaemk merged commit c1eb345 into master Jul 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant