From 7a7867aac42eef1af15a5bd5509b6aefc1605f51 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Wed, 5 Jul 2023 11:23:04 -0600 Subject: [PATCH] Suppress a Clippy false alarm. --- src/mutex.rs | 3 +++ src/rwlock.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/mutex.rs b/src/mutex.rs index e156081..633ff9b 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -216,6 +216,9 @@ impl Clone for Mutex { impl Mutex { /// Create a new `Mutex` in the unlocked state. + // Clippy doesn't like Arc around a non-Send field. But Mutex's access + // rules make it Send, which is why we need Arc instead of Rc. + #[allow(clippy::arc_with_non_send_sync)] pub fn new(t: T) -> Mutex { let mutex_data = MutexData { owned: false, diff --git a/src/rwlock.rs b/src/rwlock.rs index 4968fec..e4abbaa 100644 --- a/src/rwlock.rs +++ b/src/rwlock.rs @@ -270,6 +270,9 @@ impl Clone for RwLock { impl RwLock { /// Create a new `RwLock` in the unlocked state. + // Clippy doesn't like Arc around a non-Send field. But Mutex's access + // rules make it Send, which is why we need Arc instead of Rc. + #[allow(clippy::arc_with_non_send_sync)] pub fn new(t: T) -> RwLock { let lock_data = RwLockData { exclusive: false,