about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2020-04-22 07:47:31 +0200
committerPhilipp Hansch <dev@phansch.net>2020-04-22 07:57:56 +0200
commit23b9f46fff4453fb90611c2fb554e004f1cec096 (patch)
tree4b8df569f90c5be69d0f10e84686489faa4c3500 /src/libstd/sync
parent8ce3f840ae9b735a66531996c32330f24b877cb0 (diff)
downloadrust-23b9f46fff4453fb90611c2fb554e004f1cec096.tar.gz
rust-23b9f46fff4453fb90611c2fb554e004f1cec096.zip
More diagnostic items for Clippy usage
This adds a couple of more diagnostic items to be used in Clippy.
I chose these particular ones because they were the types which we seem
to check for the most in Clippy. I'm not sure if the
`cfg_attr(not(test))` is needed, but it was also used for `Vec` and a
few other types.
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/mutex.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs
index 0cb16b19d73..797b22fdd12 100644
--- a/src/libstd/sync/mutex.rs
+++ b/src/libstd/sync/mutex.rs
@@ -108,6 +108,7 @@ use crate::sys_common::poison::{self, LockResult, TryLockError, TryLockResult};
 /// *guard += 1;
 /// ```
 #[stable(feature = "rust1", since = "1.0.0")]
+#[cfg_attr(not(test), rustc_diagnostic_item = "mutex_type")]
 pub struct Mutex<T: ?Sized> {
     // Note that this mutex is in a *box*, not inlined into the struct itself.
     // Once a native mutex has been used once, its address can never change (it