diff options
Diffstat (limited to 'src/collection/boxed.rs')
| -rw-r--r-- | src/collection/boxed.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/collection/boxed.rs b/src/collection/boxed.rs index a048d2b..c0cc294 100644 --- a/src/collection/boxed.rs +++ b/src/collection/boxed.rs @@ -21,6 +21,7 @@ fn contains_duplicates(l: &[&dyn RawLock]) -> bool { } unsafe impl<L: Lockable> RawLock for BoxedLockCollection<L> { + #[mutants::skip] // this should never be called fn poison(&self) { for lock in &self.locks { lock.poison(); @@ -84,6 +85,9 @@ unsafe impl<L: Sharable> Sharable for BoxedLockCollection<L> { unsafe impl<L: OwnedLockable> OwnedLockable for BoxedLockCollection<L> {} +// LockableGetMut can't be implemented because that would create mutable and +// immutable references to the same value at the same time. + impl<L: LockableIntoInner> LockableIntoInner for BoxedLockCollection<L> { type Inner = L::Inner; @@ -131,7 +135,7 @@ unsafe impl<L: Send> Send for BoxedLockCollection<L> {} unsafe impl<L: Sync> Sync for BoxedLockCollection<L> {} impl<L> Drop for BoxedLockCollection<L> { - #[mutants::skip] + #[mutants::skip] // i can't test for a memory leak fn drop(&mut self) { unsafe { // safety: this collection will never be locked again @@ -203,6 +207,9 @@ impl<L> BoxedLockCollection<L> { } } + // child_mut is immediate UB because it leads to mutable and immutable + // references happening at the same time + /// Gets an immutable reference to the underlying data #[must_use] pub fn child(&self) -> &L { |
