mirror of
https://github.com/rust-lang/futures-rs.git
synced 2026-01-25 03:26:14 +00:00
Add #[clippy::has_significant_drop] to guards (#2967)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user