diff options
| author | Aaron Kofsky <aaronko@umich.edu> | 2022-06-05 01:01:54 -0400 |
|---|---|---|
| committer | Aaron Kofsky <aaronko@umich.edu> | 2022-06-05 01:01:54 -0400 |
| commit | 321a598b7519733aff7dea8b4ebd3631626d656b (patch) | |
| tree | 71cd55e973aa7c0084744cd0b79f4d68ff504c04 /library/std/src/sync | |
| parent | b5b5b5471ba324f6b4d5a53957a800ad44126964 (diff) | |
Add diagnostic items to MutexGuard and RwLock Guards
I forgot to add the diagnostic to the actual types in `std` earlier.
Diffstat (limited to 'library/std/src/sync')
| -rw-r--r-- | library/std/src/sync/mutex.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sync/rwlock.rs | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/sync/mutex.rs b/library/std/src/sync/mutex.rs index 3d8281fe593..d976725c276 100644 --- a/library/std/src/sync/mutex.rs +++ b/library/std/src/sync/mutex.rs @@ -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, diff --git a/library/std/src/sync/rwlock.rs b/library/std/src/sync/rwlock.rs index 4f1b4bedaab..e956f00a12f 100644 --- a/library/std/src/sync/rwlock.rs +++ b/library/std/src/sync/rwlock.rs @@ -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, |
