about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMax Baumann <max@bmn.dev>2022-03-24 17:05:47 +0100
committerMax Baumann <max@bmn.dev>2022-03-24 18:18:44 +0100
commit64ad96dd9a9a1725ee00ba1033abc70f96d2c5b1 (patch)
treed61e6adae81356de2888ef04fdb130ee4337c4dc
parent8d8135f003b35c3e109d013b2bed9ee9496da615 (diff)
downloadrust-64ad96dd9a9a1725ee00ba1033abc70f96d2c5b1.tar.gz
rust-64ad96dd9a9a1725ee00ba1033abc70f96d2c5b1.zip
add diagnostic items for clippy's
-rw-r--r--compiler/rustc_span/src/symbol.rs4
-rw-r--r--library/core/src/str/mod.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 48ca321b737..5cf362bfa7e 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1347,6 +1347,10 @@ symbols! {
         store,
         str,
         str_alloc,
+        str_split_whitespace,
+        str_trim,
+        str_trim_end,
+        str_trim_start,
         stringify,
         stringify_macro,
         struct_field_attributes,
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index b1d36f27107..c603420f0f8 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -904,6 +904,7 @@ impl str {
     #[must_use = "this returns the split string as an iterator, \
                   without modifying the original"]
     #[stable(feature = "split_whitespace", since = "1.1.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "str_split_whitespace")]
     #[inline]
     pub fn split_whitespace(&self) -> SplitWhitespace<'_> {
         SplitWhitespace { inner: self.split(IsWhitespace).filter(IsNotEmpty) }
@@ -1846,6 +1847,7 @@ impl str {
     #[must_use = "this returns the trimmed string as a slice, \
                   without modifying the original"]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "str_trim")]
     pub fn trim(&self) -> &str {
         self.trim_matches(|c: char| c.is_whitespace())
     }
@@ -1884,6 +1886,7 @@ impl str {
     #[must_use = "this returns the trimmed string as a new slice, \
                   without modifying the original"]
     #[stable(feature = "trim_direction", since = "1.30.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "str_trim_start")]
     pub fn trim_start(&self) -> &str {
         self.trim_start_matches(|c: char| c.is_whitespace())
     }
@@ -1922,6 +1925,7 @@ impl str {
     #[must_use = "this returns the trimmed string as a new slice, \
                   without modifying the original"]
     #[stable(feature = "trim_direction", since = "1.30.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "str_trim_end")]
     pub fn trim_end(&self) -> &str {
         self.trim_end_matches(|c: char| c.is_whitespace())
     }