From 92ff1a5988cdea5851930e286fd8a0abfd744471 Mon Sep 17 00:00:00 2001 From: Mica White Date: Mon, 11 Mar 2024 22:09:33 -0400 Subject: Fix trait bounds --- src/rwlock/read_guard.rs | 10 +++++++++- src/rwlock/rwlock.rs | 2 +- src/rwlock/write_guard.rs | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src/rwlock') diff --git a/src/rwlock/read_guard.rs b/src/rwlock/read_guard.rs index d8db9b9..074b0a9 100644 --- a/src/rwlock/read_guard.rs +++ b/src/rwlock/read_guard.rs @@ -46,7 +46,15 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Self { rwlock: RwLockReadRef(rwlock), thread_key, - _phantom: PhantomData, + _phantom1: PhantomData, + _phantom2: PhantomData, } } } + +unsafe impl<'a, T: ?Sized + 'a, R: RawRwLock> Sync for RwLockReadRef<'a, T, R> {} + +unsafe impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Sync + for RwLockReadGuard<'a, 'key, T, Key, R> +{ +} diff --git a/src/rwlock/rwlock.rs b/src/rwlock/rwlock.rs index b1c7ff0..b1c4def 100644 --- a/src/rwlock/rwlock.rs +++ b/src/rwlock/rwlock.rs @@ -370,4 +370,4 @@ impl RwLock { } unsafe impl Send for RwLock {} -unsafe impl Sync for RwLock {} +unsafe impl Sync for RwLock {} diff --git a/src/rwlock/write_guard.rs b/src/rwlock/write_guard.rs index dd168bf..9350425 100644 --- a/src/rwlock/write_guard.rs +++ b/src/rwlock/write_guard.rs @@ -63,7 +63,15 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Self { rwlock: RwLockWriteRef(rwlock), thread_key, - _phantom: PhantomData, + _phantom1: PhantomData, + _phantom2: PhantomData, } } } + +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> +{ +} -- cgit v1.2.3