Add diagnostic items to MutexGuard and RwLock Guards
I forgot to add the diagnostic to the actual types in `std` earlier.
This commit is contained in:
parent
b5b5b5471b
commit
321a598b75
@ -193,6 +193,7 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}
|
||||
and cause Futures to not implement `Send`"]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[clippy::has_significant_drop]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "MutexGuard")]
|
||||
pub struct MutexGuard<'a, T: ?Sized + 'a> {
|
||||
lock: &'a Mutex<T>,
|
||||
poison: poison::Guard,
|
||||
|
@ -100,6 +100,7 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
|
||||
and cause Futures to not implement `Send`"]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[clippy::has_significant_drop]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "RwLockReadGuard")]
|
||||
pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
|
||||
lock: &'a RwLock<T>,
|
||||
}
|
||||
@ -124,6 +125,7 @@ unsafe impl<T: ?Sized + Sync> Sync for RwLockReadGuard<'_, T> {}
|
||||
and cause Future's to not implement `Send`"]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[clippy::has_significant_drop]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "RwLockWriteGuard")]
|
||||
pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
|
||||
lock: &'a RwLock<T>,
|
||||
poison: poison::Guard,
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: non-binding let on a synchronization lock
|
||||
--> $DIR/let_underscore_lock.rs:5:5
|
||||
--> $DIR/let_underscore_lock.rs:6:5
|
||||
|
|
||||
LL | let _ = data.lock().unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user