summaryrefslogtreecommitdiff
path: root/src/rwlock
diff options
context:
space:
mode:
Diffstat (limited to 'src/rwlock')
-rw-r--r--src/rwlock/read_guard.rs8
-rw-r--r--src/rwlock/read_lock.rs1
-rw-r--r--src/rwlock/rwlock.rs1
-rw-r--r--src/rwlock/write_guard.rs8
-rw-r--r--src/rwlock/write_lock.rs1
5 files changed, 19 insertions, 0 deletions
diff --git a/src/rwlock/read_guard.rs b/src/rwlock/read_guard.rs
index 8678a8e..2195e44 100644
--- a/src/rwlock/read_guard.rs
+++ b/src/rwlock/read_guard.rs
@@ -33,12 +33,14 @@ impl<T: Ord + ?Sized, R: RawRwLock> Ord for RwLockReadRef<'_, T, R> {
}
}
+#[mutants::skip] // hashing involves PRNG and is hard to test
impl<T: Hash + ?Sized, R: RawRwLock> Hash for RwLockReadRef<'_, T, R> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.deref().hash(state)
}
}
+#[mutants::skip]
impl<T: Debug + ?Sized, R: RawRwLock> Debug for RwLockReadRef<'_, T, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(&**self, f)
@@ -85,6 +87,7 @@ impl<'a, T: ?Sized, R: RawRwLock> RwLockReadRef<'a, T, R> {
}
}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: PartialEq + ?Sized, R: RawRwLock, Key: Keyable> PartialEq
for RwLockReadGuard<'_, '_, T, Key, R>
{
@@ -93,8 +96,10 @@ impl<T: PartialEq + ?Sized, R: RawRwLock, Key: Keyable> PartialEq
}
}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: Eq + ?Sized, R: RawRwLock, Key: Keyable> Eq for RwLockReadGuard<'_, '_, T, Key, R> {}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: PartialOrd + ?Sized, R: RawRwLock, Key: Keyable> PartialOrd
for RwLockReadGuard<'_, '_, T, Key, R>
{
@@ -103,18 +108,21 @@ impl<T: PartialOrd + ?Sized, R: RawRwLock, Key: Keyable> PartialOrd
}
}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: Ord + ?Sized, R: RawRwLock, Key: Keyable> Ord for RwLockReadGuard<'_, '_, T, Key, R> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.deref().cmp(&**other)
}
}
+#[mutants::skip] // hashing involves PRNG and is hard to test
impl<T: Hash + ?Sized, R: RawRwLock, Key: Keyable> Hash for RwLockReadGuard<'_, '_, T, Key, R> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.deref().hash(state)
}
}
+#[mutants::skip]
impl<T: Debug + ?Sized, Key: Keyable, R: RawRwLock> Debug for RwLockReadGuard<'_, '_, T, Key, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(&**self, f)
diff --git a/src/rwlock/read_lock.rs b/src/rwlock/read_lock.rs
index ae593e2..5ac0bbb 100644
--- a/src/rwlock/read_lock.rs
+++ b/src/rwlock/read_lock.rs
@@ -33,6 +33,7 @@ unsafe impl<T: Send, R: RawRwLock + Send + Sync> Sharable for ReadLock<'_, T, R>
}
}
+#[mutants::skip]
impl<T: ?Sized + Debug, R: RawRwLock> Debug for ReadLock<'_, T, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// safety: this is just a try lock, and the value is dropped
diff --git a/src/rwlock/rwlock.rs b/src/rwlock/rwlock.rs
index a249675..7a105d7 100644
--- a/src/rwlock/rwlock.rs
+++ b/src/rwlock/rwlock.rs
@@ -140,6 +140,7 @@ impl<T, R: RawRwLock> RwLock<T, R> {
}
}
+#[mutants::skip]
impl<T: ?Sized + Debug, R: RawRwLock> Debug for RwLock<T, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// safety: this is just a try lock, and the value is dropped
diff --git a/src/rwlock/write_guard.rs b/src/rwlock/write_guard.rs
index aec3d3d..ff559b8 100644
--- a/src/rwlock/write_guard.rs
+++ b/src/rwlock/write_guard.rs
@@ -33,12 +33,14 @@ impl<T: Ord + ?Sized, R: RawRwLock> Ord for RwLockWriteRef<'_, T, R> {
}
}
+#[mutants::skip] // hashing involves PRNG and is difficult to test
impl<T: Hash + ?Sized, R: RawRwLock> Hash for RwLockWriteRef<'_, T, R> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.deref().hash(state)
}
}
+#[mutants::skip]
impl<T: Debug + ?Sized, R: RawRwLock> Debug for RwLockWriteRef<'_, T, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(&**self, f)
@@ -100,6 +102,7 @@ impl<'a, T: ?Sized + 'a, R: RawRwLock> RwLockWriteRef<'a, T, R> {
}
}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: PartialEq + ?Sized, R: RawRwLock, Key: Keyable> PartialEq
for RwLockWriteGuard<'_, '_, T, Key, R>
{
@@ -108,8 +111,10 @@ impl<T: PartialEq + ?Sized, R: RawRwLock, Key: Keyable> PartialEq
}
}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: Eq + ?Sized, R: RawRwLock, Key: Keyable> Eq for RwLockWriteGuard<'_, '_, T, Key, R> {}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: PartialOrd + ?Sized, R: RawRwLock, Key: Keyable> PartialOrd
for RwLockWriteGuard<'_, '_, T, Key, R>
{
@@ -118,18 +123,21 @@ impl<T: PartialOrd + ?Sized, R: RawRwLock, Key: Keyable> PartialOrd
}
}
+#[mutants::skip] // it's hard to get two read guards safely
impl<T: Ord + ?Sized, R: RawRwLock, Key: Keyable> Ord for RwLockWriteGuard<'_, '_, T, Key, R> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.deref().cmp(&**other)
}
}
+#[mutants::skip] // hashing involves PRNG and is difficult to test
impl<T: Hash + ?Sized, R: RawRwLock, Key: Keyable> Hash for RwLockWriteGuard<'_, '_, T, Key, R> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.deref().hash(state)
}
}
+#[mutants::skip]
impl<T: Debug + ?Sized, Key: Keyable, R: RawRwLock> Debug for RwLockWriteGuard<'_, '_, T, Key, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(&**self, f)
diff --git a/src/rwlock/write_lock.rs b/src/rwlock/write_lock.rs
index ff00c06..443fbcd 100644
--- a/src/rwlock/write_lock.rs
+++ b/src/rwlock/write_lock.rs
@@ -25,6 +25,7 @@ unsafe impl<T: Send, R: RawRwLock + Send + Sync> Lockable for WriteLock<'_, T, R
// Technically, the exclusive locks can also be shared, but there's currently
// no way to express that. I don't think I want to ever express that.
+#[mutants::skip]
impl<T: ?Sized + Debug, R: RawRwLock> Debug for WriteLock<'_, T, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// safety: this is just a try lock, and the value is dropped