From dc16634f4abdb1e830d2749e64b419740702b302 Mon Sep 17 00:00:00 2001 From: Mica White Date: Thu, 26 Dec 2024 11:26:39 -0500 Subject: Commenting --- src/collection/boxed.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/collection/boxed.rs') 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 RawLock for BoxedLockCollection { + #[mutants::skip] // this should never be called fn poison(&self) { for lock in &self.locks { lock.poison(); @@ -84,6 +85,9 @@ unsafe impl Sharable for BoxedLockCollection { unsafe impl OwnedLockable for BoxedLockCollection {} +// LockableGetMut can't be implemented because that would create mutable and +// immutable references to the same value at the same time. + impl LockableIntoInner for BoxedLockCollection { type Inner = L::Inner; @@ -131,7 +135,7 @@ unsafe impl Send for BoxedLockCollection {} unsafe impl Sync for BoxedLockCollection {} impl Drop for BoxedLockCollection { - #[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 BoxedLockCollection { } } + // 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 { -- cgit v1.2.3