]> git.lizzy.rs Git - rust.git/commitdiff
Mark locks in std lib with clippy::has_significant_drop
authorPreston From <prestonfrom@gmail.com>
Fri, 15 Apr 2022 07:01:36 +0000 (01:01 -0600)
committerPreston From <prestonfrom@gmail.com>
Sat, 7 May 2022 03:48:17 +0000 (21:48 -0600)
library/std/src/sync/mutex.rs
library/std/src/sync/rwlock.rs

index 3ea0a6c3937605261762f0e9d87845742f44fd09..aacc893ba06468e6f7e2e54e125495c3b1cd4f0b 100644 (file)
@@ -192,6 +192,7 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}
                       points can cause deadlocks, delays, \
                       and cause Futures to not implement `Send`"]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[clippy::has_significant_drop]
 pub struct MutexGuard<'a, T: ?Sized + 'a> {
     lock: &'a Mutex<T>,
     poison: poison::Guard,
index ed62fa977becab7b56065382c333d2b945b8b5b4..9ec0903f037ccf9c40ad24264abaee9f076552db 100644 (file)
@@ -99,6 +99,7 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
                       points can cause deadlocks, delays, \
                       and cause Futures to not implement `Send`"]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[clippy::has_significant_drop]
 pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
     lock: &'a RwLock<T>,
 }
@@ -122,6 +123,7 @@ unsafe impl<T: ?Sized + Sync> Sync for RwLockReadGuard<'_, T> {}
                       points can cause deadlocks, delays, \
                       and cause Future's to not implement `Send`"]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[clippy::has_significant_drop]
 pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
     lock: &'a RwLock<T>,
     poison: poison::Guard,