Skip to content

Commit 2bb9a28

Browse files
authored
Add #[clippy::has_significant_drop] to guards (#2967)
1 parent 2735494 commit 2bb9a28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

futures-util/src/lock/mutex.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ impl<T: ?Sized> Drop for OwnedMutexLockFuture<T> {
279279
/// An RAII guard returned by the `lock_owned` and `try_lock_owned` methods.
280280
/// When this structure is dropped (falls out of scope), the lock will be
281281
/// unlocked.
282+
#[clippy::has_significant_drop]
282283
pub struct OwnedMutexGuard<T: ?Sized> {
283284
mutex: Arc<Mutex<T>>,
284285
}
@@ -388,6 +389,7 @@ impl<T: ?Sized> Drop for MutexLockFuture<'_, T> {
388389
/// An RAII guard returned by the `lock` and `try_lock` methods.
389390
/// When this structure is dropped (falls out of scope), the lock will be
390391
/// unlocked.
392+
#[clippy::has_significant_drop]
391393
pub struct MutexGuard<'a, T: ?Sized> {
392394
mutex: &'a Mutex<T>,
393395
}
@@ -449,6 +451,7 @@ impl<T: ?Sized> DerefMut for MutexGuard<'_, T> {
449451

450452
/// An RAII guard returned by the `MutexGuard::map` and `MappedMutexGuard::map` methods.
451453
/// When this structure is dropped (falls out of scope), the lock will be unlocked.
454+
#[clippy::has_significant_drop]
452455
pub struct MappedMutexGuard<'a, T: ?Sized, U: ?Sized> {
453456
mutex: &'a Mutex<T>,
454457
value: *mut U,

0 commit comments

Comments
 (0)