Skip to content
Open
Changes from 1 commit
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
Next Next commit
Add #[has_significant_drop] to guards
  • Loading branch information
c410-f3r authored Sep 3, 2025
commit 76e0eb374afc80ae70af6cd9ceb8c02d2231ec20
3 changes: 3 additions & 0 deletions futures-util/src/lock/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#[has_significant_drop]
pub struct OwnedMutexGuard<T: ?Sized> {
mutex: Arc<Mutex<T>>,
}
Expand Down Expand Up @@ -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.
#[has_significant_drop]
pub struct MutexGuard<'a, T: ?Sized> {
mutex: &'a Mutex<T>,
}
Expand Down Expand Up @@ -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.
#[has_significant_drop]
pub struct MappedMutexGuard<'a, T: ?Sized, U: ?Sized> {
mutex: &'a Mutex<T>,
value: *mut U,
Expand Down
Loading