error[E0277]: the trait bound `MyValue: Clone` is not satisfied
--> tests/compile_tests/default/clone/sync_cache_clone.rs:18:41
|
18 | let _cache: Cache<MyKey, MyValue> = Cache::new(CAP);
| ^^^^^^^^^^ the trait `Clone` is not implemented for `MyValue`
|
note: required by a bound in `moka::sync::Cache::<K, V>::new`
--> src/sync/cache.rs
|
| V: Clone + Send + Sync + 'static,
| ^^^^^ required by this bound in `Cache::<K, V>::new`
...
| pub fn new(max_capacity: u64) -> Self {
| --- required by a bound in this associated function
help: consider annotating `MyValue` with `#[derive(Clone)]`
|
41 + #[derive(Clone)]
42 | pub struct MyValue(i32);
|
error[E0277]: the trait bound `MyBuildHasher1: Clone` is not satisfied
--> tests/compile_tests/default/clone/sync_cache_clone.rs:28:84
|
28 | let _cache: Cache<MyKey, Arc<MyValue>, _> = Cache::builder().build_with_hasher(MyBuildHasher1);
| ----------------- ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `MyBuildHasher1`
| |
| required by a bound introduced by this call
|
note: required by a bound in `moka::sync::CacheBuilder::<K, V, moka::sync::Cache<K, V>>::build_with_hasher`
--> src/sync/builder.rs
|
| pub fn build_with_hasher<S>(self, hasher: S) -> Cache<K, V, S>
| ----------------- required by a bound in this associated function
| where
| S: BuildHasher + Clone + Send + Sync + 'static,
| ^^^^^ required by this bound in `CacheBuilder::<K, V, Cache<K, V>>::build_with_hasher`
help: consider annotating `MyBuildHasher1` with `#[derive(Clone)]`
|
44 + #[derive(Clone)]
45 | pub struct MyBuildHasher1;
|