Skip to content

Commit bbb1c5b

Browse files
committed
Mark locks in std lib with clippy::has_significant_drop
1 parent 4799baa commit bbb1c5b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

library/std/src/sync/mutex.rs

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}
192192
points can cause deadlocks, delays, \
193193
and cause Futures to not implement `Send`"]
194194
#[stable(feature = "rust1", since = "1.0.0")]
195+
#[clippy::has_significant_drop]
195196
pub struct MutexGuard<'a, T: ?Sized + 'a> {
196197
lock: &'a Mutex<T>,
197198
poison: poison::Guard,

library/std/src/sync/rwlock.rs

+2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
9999
points can cause deadlocks, delays, \
100100
and cause Futures to not implement `Send`"]
101101
#[stable(feature = "rust1", since = "1.0.0")]
102+
#[clippy::has_significant_drop]
102103
pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
103104
lock: &'a RwLock<T>,
104105
}
@@ -122,6 +123,7 @@ unsafe impl<T: ?Sized + Sync> Sync for RwLockReadGuard<'_, T> {}
122123
points can cause deadlocks, delays, \
123124
and cause Future's to not implement `Send`"]
124125
#[stable(feature = "rust1", since = "1.0.0")]
126+
#[clippy::has_significant_drop]
125127
pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
126128
lock: &'a RwLock<T>,
127129
poison: poison::Guard,

0 commit comments

Comments
 (0)