about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-22 12:18:39 +0200
committerGitHub <noreply@github.com>2020-04-22 12:18:39 +0200
commit01fdc885d6bd5ee9651fce930cc10d05dc274988 (patch)
tree722ec4987cf5b54446a89b0a276f0edf046fb51d /src/liballoc
parent91ef66374bf403e1f0c3fe9c0f9db9941898c045 (diff)
parent23b9f46fff4453fb90611c2fb554e004f1cec096 (diff)
downloadrust-01fdc885d6bd5ee9651fce930cc10d05dc274988.tar.gz
rust-01fdc885d6bd5ee9651fce930cc10d05dc274988.zip
Rollup merge of #71414 - phansch:more-diagnostic-items, r=Manishearth
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.

cc https://github.com/rust-lang/rust-clippy/issues/5393

r? @Manishearth
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/vec_deque.rs1
-rw-r--r--src/liballoc/string.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs
index 091b068b0b2..a3b61f1f4a5 100644
--- a/src/liballoc/collections/vec_deque.rs
+++ b/src/liballoc/collections/vec_deque.rs
@@ -50,6 +50,7 @@ const MAXIMUM_ZST_CAPACITY: usize = 1 << (64 - 1); // Largest possible power of
 /// [`pop_front`]: #method.pop_front
 /// [`extend`]: #method.extend
 /// [`append`]: #method.append
+#[cfg_attr(not(test), rustc_diagnostic_item = "vecdeque_type")]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct VecDeque<T> {
     // tail and head are pointers into the buffer. Tail always points
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index 80fa8139915..f3fe1adebb1 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -278,6 +278,7 @@ use crate::vec::Vec;
 /// [`Deref`]: ../../std/ops/trait.Deref.html
 /// [`as_str()`]: struct.String.html#method.as_str
 #[derive(PartialOrd, Eq, Ord)]
+#[cfg_attr(not(test), rustc_diagnostic_item = "string_type")]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct String {
     vec: Vec<u8>,