Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ impl<T: ?Sized, B: Borrow<Mutex<T>>> Drop for AcquireSlow<B, T> {
}

/// A guard that releases the mutex when dropped.
#[clippy::has_significant_drop]
pub struct MutexGuard<'a, T: ?Sized>(&'a Mutex<T>);

unsafe impl<T: Send + ?Sized> Send for MutexGuard<'_, T> {}
Expand Down Expand Up @@ -595,6 +596,7 @@ impl<T: ?Sized> DerefMut for MutexGuard<'_, T> {
}

/// An owned guard that releases the mutex when dropped.
#[clippy::has_significant_drop]
pub struct MutexGuardArc<T: ?Sized>(Arc<Mutex<T>>);

unsafe impl<T: Send + ?Sized> Send for MutexGuardArc<T> {}
Expand Down
3 changes: 3 additions & 0 deletions src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ impl<'a, T: ?Sized> Future for Write<'a, T> {
}

/// A guard that releases the read lock when dropped.
#[clippy::has_significant_drop]
pub struct RwLockReadGuard<'a, T: ?Sized>(&'a RwLock<T>);

unsafe impl<T: Sync + ?Sized> Send for RwLockReadGuard<'_, T> {}
Expand Down Expand Up @@ -640,6 +641,7 @@ impl<T: ?Sized> Deref for RwLockReadGuard<'_, T> {
}

/// A guard that releases the upgradable read lock when dropped.
#[clippy::has_significant_drop]
pub struct RwLockUpgradableReadGuard<'a, T: ?Sized> {
reader: RwLockReadGuard<'a, T>,
reserved: MutexGuard<'a, ()>,
Expand Down Expand Up @@ -851,6 +853,7 @@ impl<T: ?Sized> Drop for RwLockWriteGuardInner<'_, T> {
}

/// A guard that releases the write lock when dropped.
#[clippy::has_significant_drop]
pub struct RwLockWriteGuard<'a, T: ?Sized> {
writer: RwLockWriteGuardInner<'a, T>,
reserved: MutexGuard<'a, ()>,
Expand Down
2 changes: 2 additions & 0 deletions src/semaphore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ impl Future for AcquireArc {
}

/// A guard that releases the acquired permit.
#[clippy::has_significant_drop]
#[derive(Debug)]
pub struct SemaphoreGuard<'a>(&'a Semaphore);

Expand All @@ -255,6 +256,7 @@ impl Drop for SemaphoreGuard<'_> {
}

/// An owned guard that releases the acquired permit.
#[clippy::has_significant_drop]
#[derive(Debug)]
pub struct SemaphoreGuardArc(Arc<Semaphore>);

Expand Down