diff options
| author | Mica White <botahamec@outlook.com> | 2024-03-11 22:41:13 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2024-03-11 22:41:13 -0400 |
| commit | a22ffadbebddcbec9bb127b295f8a8516174e6e6 (patch) | |
| tree | 66925b072f43646aafb40834e293c11b98f08c87 /src/rwlock/rwlock.rs | |
| parent | ef34f899313ed4e4c5e452aef2c670f7d51f1ca9 (diff) | |
More trait bound fixes
Diffstat (limited to 'src/rwlock/rwlock.rs')
| -rw-r--r-- | src/rwlock/rwlock.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rwlock/rwlock.rs b/src/rwlock/rwlock.rs index b1c4def..dc5ab30 100644 --- a/src/rwlock/rwlock.rs +++ b/src/rwlock/rwlock.rs @@ -1,5 +1,5 @@ -use std::cell::UnsafeCell; use std::fmt::Debug; +use std::{cell::UnsafeCell, marker::PhantomData}; use lock_api::RawRwLock; @@ -161,7 +161,7 @@ impl<T: ?Sized, R: RawRwLock> RwLock<T, R> { self.raw.lock_shared(); // safety: the lock is locked first - RwLockReadRef(self) + RwLockReadRef(self, PhantomData) } /// Attempts to acquire this `RwLock` with shared read access without @@ -203,7 +203,7 @@ impl<T: ?Sized, R: RawRwLock> RwLock<T, R> { pub(crate) unsafe fn try_read_no_key(&self) -> Option<RwLockReadRef<'_, T, R>> { if self.raw.try_lock_shared() { // safety: the lock is locked first - Some(RwLockReadRef(self)) + Some(RwLockReadRef(self, PhantomData)) } else { None } @@ -252,7 +252,7 @@ impl<T: ?Sized, R: RawRwLock> RwLock<T, R> { self.raw.lock_exclusive(); // safety: the lock is locked first - RwLockWriteRef(self) + RwLockWriteRef(self, PhantomData) } /// Attempts to lock this `RwLock` with exclusive write access. @@ -295,7 +295,7 @@ impl<T: ?Sized, R: RawRwLock> RwLock<T, R> { pub(crate) unsafe fn try_write_no_key(&self) -> Option<RwLockWriteRef<'_, T, R>> { if self.raw.try_lock_exclusive() { // safety: the lock is locked first - Some(RwLockWriteRef(self)) + Some(RwLockWriteRef(self, PhantomData)) } else { None } |
