summaryrefslogtreecommitdiff
path: root/src/collection/boxed.rs
diff options
context:
space:
mode:
authorMica White <botahamec@gmail.com>2024-12-26 11:26:39 -0500
committerMica White <botahamec@gmail.com>2024-12-26 12:06:47 -0500
commitdc16634f4abdb1e830d2749e64b419740702b302 (patch)
treeeb51ba8293a1c719c7221d546185cfa7062c108c /src/collection/boxed.rs
parent096afea6f13692fddbfad0b07e5377cb2e81dd58 (diff)
Commenting
Diffstat (limited to 'src/collection/boxed.rs')
-rw-r--r--src/collection/boxed.rs9
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 {