Add #[clippy::has_significant_drop] to guards (#2967)

This commit is contained in:
Caio
2026-01-20 12:09:58 -03:00
committed by GitHub
parent 27354944b0
commit 2bb9a288a9

View File

@@ -279,6 +279,7 @@ impl<T: ?Sized> Drop for OwnedMutexLockFuture<T> {
/// An RAII guard returned by the `lock_owned` and `try_lock_owned` methods.
/// When this structure is dropped (falls out of scope), the lock will be
/// unlocked.
#[clippy::has_significant_drop]
pub struct OwnedMutexGuard<T: ?Sized> {
mutex: Arc<Mutex<T>>,
}
@@ -388,6 +389,7 @@ impl<T: ?Sized> Drop for MutexLockFuture<'_, T> {
/// An RAII guard returned by the `lock` and `try_lock` methods.
/// When this structure is dropped (falls out of scope), the lock will be
/// unlocked.
#[clippy::has_significant_drop]
pub struct MutexGuard<'a, T: ?Sized> {
mutex: &'a Mutex<T>,
}
@@ -449,6 +451,7 @@ impl<T: ?Sized> DerefMut for MutexGuard<'_, T> {
/// An RAII guard returned by the `MutexGuard::map` and `MappedMutexGuard::map` methods.
/// When this structure is dropped (falls out of scope), the lock will be unlocked.
#[clippy::has_significant_drop]
pub struct MappedMutexGuard<'a, T: ?Sized, U: ?Sized> {
mutex: &'a Mutex<T>,
value: *mut U,