summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-11 22:26:02 -0400
committerMica White <botahamec@outlook.com>2024-03-11 22:26:02 -0400
commitef34f899313ed4e4c5e452aef2c670f7d51f1ca9 (patch)
treefcd6462f8633abf4d572ad10b3423e50d674d67a
parent92ff1a5988cdea5851930e286fd8a0abfd744471 (diff)
Further fixes to trait bounds
-rw-r--r--src/mutex.rs1
-rw-r--r--src/mutex/guard.rs8
-rw-r--r--src/rwlock/write_guard.rs7
3 files changed, 2 insertions, 14 deletions
diff --git a/src/mutex.rs b/src/mutex.rs
index 431eedc..ed8d4a4 100644
--- a/src/mutex.rs
+++ b/src/mutex.rs
@@ -49,6 +49,5 @@ pub struct MutexRef<'a, T: ?Sized + 'a, R: RawMutex>(&'a Mutex<T, R>);
pub struct MutexGuard<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable + 'key, R: RawMutex> {
mutex: MutexRef<'a, T, R>,
thread_key: Key,
- _phantom1: PhantomData<*const ()>, // implement !Send
_phantom2: PhantomData<&'key ()>,
}
diff --git a/src/mutex/guard.rs b/src/mutex/guard.rs
index 5a2a2c1..f57926d 100644
--- a/src/mutex/guard.rs
+++ b/src/mutex/guard.rs
@@ -61,15 +61,9 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawMutex> MutexGuard<'a, 'ke
Self {
mutex: MutexRef(mutex),
thread_key,
- _phantom1: PhantomData,
_phantom2: PhantomData,
}
}
}
-unsafe impl<'a, T: ?Sized + 'a, R: RawMutex> Sync for MutexRef<'a, T, R> {}
-
-unsafe impl<'a, 'key: 'a, T: ?Sized + Sync, Key: Keyable + 'key, R: RawMutex> Sync
- for MutexGuard<'_, 'key, T, Key, R>
-{
-}
+unsafe impl<'a, T: ?Sized + Send + 'a, R: RawMutex + Sync + 'a> Sync for MutexRef<'a, T, R> {}
diff --git a/src/rwlock/write_guard.rs b/src/rwlock/write_guard.rs
index 9350425..09fb898 100644
--- a/src/rwlock/write_guard.rs
+++ b/src/rwlock/write_guard.rs
@@ -69,9 +69,4 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock>
}
}
-unsafe impl<'a, T: ?Sized + 'a, R: RawRwLock> Sync for RwLockWriteRef<'a, T, R> {}
-
-unsafe impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Sync
- for RwLockWriteGuard<'a, 'key, T, Key, R>
-{
-}
+unsafe impl<'a, T: ?Sized + 'a, R: RawRwLock + Sync + 'a> Sync for RwLockWriteRef<'a, T, R> {}