From a22ffadbebddcbec9bb127b295f8a8516174e6e6 Mon Sep 17 00:00:00 2001 From: Mica White Date: Mon, 11 Mar 2024 22:41:13 -0400 Subject: More trait bound fixes --- src/rwlock/rwlock.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/rwlock/rwlock.rs') 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 RwLock { 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 RwLock { pub(crate) unsafe fn try_read_no_key(&self) -> Option> { 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 RwLock { 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 RwLock { pub(crate) unsafe fn try_write_no_key(&self) -> Option> { if self.raw.try_lock_exclusive() { // safety: the lock is locked first - Some(RwLockWriteRef(self)) + Some(RwLockWriteRef(self, PhantomData)) } else { None } -- cgit v1.2.3