@@ -904,6 +904,7 @@ impl str {
904
904
#[ must_use = "this returns the split string as an iterator, \
905
905
without modifying the original"]
906
906
#[ stable( feature = "split_whitespace" , since = "1.1.0" ) ]
907
+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "str_split_whitespace" ) ]
907
908
#[ inline]
908
909
pub fn split_whitespace ( & self ) -> SplitWhitespace < ' _ > {
909
910
SplitWhitespace { inner : self . split ( IsWhitespace ) . filter ( IsNotEmpty ) }
@@ -1846,6 +1847,7 @@ impl str {
1846
1847
#[ must_use = "this returns the trimmed string as a slice, \
1847
1848
without modifying the original"]
1848
1849
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1850
+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "str_trim" ) ]
1849
1851
pub fn trim ( & self ) -> & str {
1850
1852
self . trim_matches ( |c : char | c. is_whitespace ( ) )
1851
1853
}
@@ -1884,6 +1886,7 @@ impl str {
1884
1886
#[ must_use = "this returns the trimmed string as a new slice, \
1885
1887
without modifying the original"]
1886
1888
#[ stable( feature = "trim_direction" , since = "1.30.0" ) ]
1889
+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "str_trim_start" ) ]
1887
1890
pub fn trim_start ( & self ) -> & str {
1888
1891
self . trim_start_matches ( |c : char | c. is_whitespace ( ) )
1889
1892
}
@@ -1922,6 +1925,7 @@ impl str {
1922
1925
#[ must_use = "this returns the trimmed string as a new slice, \
1923
1926
without modifying the original"]
1924
1927
#[ stable( feature = "trim_direction" , since = "1.30.0" ) ]
1928
+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "str_trim_end" ) ]
1925
1929
pub fn trim_end ( & self ) -> & str {
1926
1930
self . trim_end_matches ( |c : char | c. is_whitespace ( ) )
1927
1931
}
0 commit comments