Skip to content

Commit ba9d102

Browse files
c410-f3rtaiki-e
authored andcommitted
Add #[clippy::has_significant_drop] to guards (#2967)
1 parent 20396a8 commit ba9d102

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

futures-util/src/lock/mutex.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ impl<T: ?Sized> Drop for OwnedMutexLockFuture<T> {
276276
/// An RAII guard returned by the `lock_owned` and `try_lock_owned` methods.
277277
/// When this structure is dropped (falls out of scope), the lock will be
278278
/// unlocked.
279+
#[clippy::has_significant_drop]
279280
pub struct OwnedMutexGuard<T: ?Sized> {
280281
mutex: Arc<Mutex<T>>,
281282
}
@@ -385,6 +386,7 @@ impl<T: ?Sized> Drop for MutexLockFuture<'_, T> {
385386
/// An RAII guard returned by the `lock` and `try_lock` methods.
386387
/// When this structure is dropped (falls out of scope), the lock will be
387388
/// unlocked.
389+
#[clippy::has_significant_drop]
388390
pub struct MutexGuard<'a, T: ?Sized> {
389391
mutex: &'a Mutex<T>,
390392
}
@@ -446,6 +448,7 @@ impl<T: ?Sized> DerefMut for MutexGuard<'_, T> {
446448

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

0 commit comments

Comments
 (0)