From e30307713212a50aa6f58b18c725a16add90e532 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 17 Jun 2020 13:44:21 +0200 Subject: [PATCH] lru_cache: restrict and annotate Send impl Signed-off-by: Wolfgang Bumiller --- src/tools/lru_cache.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/lru_cache.rs b/src/tools/lru_cache.rs index 502f08f1..1033dd42 100644 --- a/src/tools/lru_cache.rs +++ b/src/tools/lru_cache.rs @@ -100,7 +100,8 @@ pub struct LruCache { _marker: PhantomData>>, } -unsafe impl Send for LruCache {} +// trivial: if our contents are Send, the whole cache is Send +unsafe impl Send for LruCache {} impl LruCache { /// Create LRU cache instance which holds up to `capacity` nodes at once.