Skip to content

Commit 64ad96d

Browse files
committed
add diagnostic items for clippy's
1 parent 8d8135f commit 64ad96d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compiler/rustc_span/src/symbol.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,10 @@ symbols! {
13471347
store,
13481348
str,
13491349
str_alloc,
1350+
str_split_whitespace,
1351+
str_trim,
1352+
str_trim_end,
1353+
str_trim_start,
13501354
stringify,
13511355
stringify_macro,
13521356
struct_field_attributes,

library/core/src/str/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ impl str {
904904
#[must_use = "this returns the split string as an iterator, \
905905
without modifying the original"]
906906
#[stable(feature = "split_whitespace", since = "1.1.0")]
907+
#[cfg_attr(not(test), rustc_diagnostic_item = "str_split_whitespace")]
907908
#[inline]
908909
pub fn split_whitespace(&self) -> SplitWhitespace<'_> {
909910
SplitWhitespace { inner: self.split(IsWhitespace).filter(IsNotEmpty) }
@@ -1846,6 +1847,7 @@ impl str {
18461847
#[must_use = "this returns the trimmed string as a slice, \
18471848
without modifying the original"]
18481849
#[stable(feature = "rust1", since = "1.0.0")]
1850+
#[cfg_attr(not(test), rustc_diagnostic_item = "str_trim")]
18491851
pub fn trim(&self) -> &str {
18501852
self.trim_matches(|c: char| c.is_whitespace())
18511853
}
@@ -1884,6 +1886,7 @@ impl str {
18841886
#[must_use = "this returns the trimmed string as a new slice, \
18851887
without modifying the original"]
18861888
#[stable(feature = "trim_direction", since = "1.30.0")]
1889+
#[cfg_attr(not(test), rustc_diagnostic_item = "str_trim_start")]
18871890
pub fn trim_start(&self) -> &str {
18881891
self.trim_start_matches(|c: char| c.is_whitespace())
18891892
}
@@ -1922,6 +1925,7 @@ impl str {
19221925
#[must_use = "this returns the trimmed string as a new slice, \
19231926
without modifying the original"]
19241927
#[stable(feature = "trim_direction", since = "1.30.0")]
1928+
#[cfg_attr(not(test), rustc_diagnostic_item = "str_trim_end")]
19251929
pub fn trim_end(&self) -> &str {
19261930
self.trim_end_matches(|c: char| c.is_whitespace())
19271931
}

0 commit comments

Comments
 (0)