Skip to content

Commit 3a0b652

Browse files
committed
Auto merge of #46411 - rillian:str_ascii, r=kennytm
Mark ascii methods on primitive types stable in 1.23.0 not 1.21.0. The ascii_methods_on_intrinsics feature stabilization didn't land in time for 1.21.0. Update the annotation so the documentation is correct about when these methods became available.
2 parents 5951f8d + 6aef5e3 commit 3a0b652

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

src/liballoc/slice.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ impl<T> [T] {
16301630
#[cfg(not(test))]
16311631
impl [u8] {
16321632
/// Checks if all bytes in this slice are within the ASCII range.
1633-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1633+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
16341634
#[inline]
16351635
pub fn is_ascii(&self) -> bool {
16361636
self.iter().all(|b| b.is_ascii())
@@ -1645,7 +1645,7 @@ impl [u8] {
16451645
/// To uppercase the value in-place, use [`make_ascii_uppercase`].
16461646
///
16471647
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase
1648-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1648+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
16491649
#[inline]
16501650
pub fn to_ascii_uppercase(&self) -> Vec<u8> {
16511651
let mut me = self.to_vec();
@@ -1662,7 +1662,7 @@ impl [u8] {
16621662
/// To lowercase the value in-place, use [`make_ascii_lowercase`].
16631663
///
16641664
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase
1665-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1665+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
16661666
#[inline]
16671667
pub fn to_ascii_lowercase(&self) -> Vec<u8> {
16681668
let mut me = self.to_vec();
@@ -1674,7 +1674,7 @@ impl [u8] {
16741674
///
16751675
/// Same as `to_ascii_lowercase(a) == to_ascii_lowercase(b)`,
16761676
/// but without allocating and copying temporaries.
1677-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1677+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
16781678
#[inline]
16791679
pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool {
16801680
self.len() == other.len() &&
@@ -1692,7 +1692,7 @@ impl [u8] {
16921692
/// [`to_ascii_uppercase`].
16931693
///
16941694
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
1695-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1695+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
16961696
#[inline]
16971697
pub fn make_ascii_uppercase(&mut self) {
16981698
for byte in self {
@@ -1709,7 +1709,7 @@ impl [u8] {
17091709
/// [`to_ascii_lowercase`].
17101710
///
17111711
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
1712-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1712+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
17131713
#[inline]
17141714
pub fn make_ascii_lowercase(&mut self) {
17151715
for byte in self {

src/liballoc/str.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ impl str {
20782078
/// assert!(ascii.is_ascii());
20792079
/// assert!(!non_ascii.is_ascii());
20802080
/// ```
2081-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2081+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
20822082
#[inline]
20832083
pub fn is_ascii(&self) -> bool {
20842084
// We can treat each byte as character here: all multibyte characters
@@ -2108,7 +2108,7 @@ impl str {
21082108
///
21092109
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase
21102110
/// [`to_uppercase`]: #method.to_uppercase
2111-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2111+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
21122112
#[inline]
21132113
pub fn to_ascii_uppercase(&self) -> String {
21142114
let mut bytes = self.as_bytes().to_vec();
@@ -2138,7 +2138,7 @@ impl str {
21382138
///
21392139
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase
21402140
/// [`to_lowercase`]: #method.to_lowercase
2141-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2141+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
21422142
#[inline]
21432143
pub fn to_ascii_lowercase(&self) -> String {
21442144
let mut bytes = self.as_bytes().to_vec();
@@ -2159,7 +2159,7 @@ impl str {
21592159
/// assert!("Ferrös".eq_ignore_ascii_case("FERRöS"));
21602160
/// assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS"));
21612161
/// ```
2162-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2162+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
21632163
#[inline]
21642164
pub fn eq_ignore_ascii_case(&self, other: &str) -> bool {
21652165
self.as_bytes().eq_ignore_ascii_case(other.as_bytes())
@@ -2174,7 +2174,7 @@ impl str {
21742174
/// [`to_ascii_uppercase`].
21752175
///
21762176
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
2177-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2177+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
21782178
pub fn make_ascii_uppercase(&mut self) {
21792179
let me = unsafe { self.as_bytes_mut() };
21802180
me.make_ascii_uppercase()
@@ -2189,7 +2189,7 @@ impl str {
21892189
/// [`to_ascii_lowercase`].
21902190
///
21912191
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
2192-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2192+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
21932193
pub fn make_ascii_lowercase(&mut self) {
21942194
let me = unsafe { self.as_bytes_mut() };
21952195
me.make_ascii_lowercase()

src/libcore/num/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ impl u8 {
22862286
/// assert!(ascii.is_ascii());
22872287
/// assert!(!non_ascii.is_ascii());
22882288
/// ```
2289-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2289+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
22902290
#[inline]
22912291
pub fn is_ascii(&self) -> bool {
22922292
*self & 128 == 0
@@ -2308,7 +2308,7 @@ impl u8 {
23082308
/// ```
23092309
///
23102310
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase
2311-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2311+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
23122312
#[inline]
23132313
pub fn to_ascii_uppercase(&self) -> u8 {
23142314
ASCII_UPPERCASE_MAP[*self as usize]
@@ -2330,7 +2330,7 @@ impl u8 {
23302330
/// ```
23312331
///
23322332
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase
2333-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2333+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
23342334
#[inline]
23352335
pub fn to_ascii_lowercase(&self) -> u8 {
23362336
ASCII_LOWERCASE_MAP[*self as usize]
@@ -2348,7 +2348,7 @@ impl u8 {
23482348
///
23492349
/// assert!(lowercase_a.eq_ignore_ascii_case(&uppercase_a));
23502350
/// ```
2351-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2351+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
23522352
#[inline]
23532353
pub fn eq_ignore_ascii_case(&self, other: &u8) -> bool {
23542354
self.to_ascii_lowercase() == other.to_ascii_lowercase()
@@ -2373,7 +2373,7 @@ impl u8 {
23732373
/// ```
23742374
///
23752375
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
2376-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2376+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
23772377
#[inline]
23782378
pub fn make_ascii_uppercase(&mut self) {
23792379
*self = self.to_ascii_uppercase();
@@ -2398,7 +2398,7 @@ impl u8 {
23982398
/// ```
23992399
///
24002400
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
2401-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2401+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
24022402
#[inline]
24032403
pub fn make_ascii_lowercase(&mut self) {
24042404
*self = self.to_ascii_lowercase();

src/libstd_unicode/char.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ impl char {
938938
/// assert!(ascii.is_ascii());
939939
/// assert!(!non_ascii.is_ascii());
940940
/// ```
941-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
941+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
942942
#[inline]
943943
pub fn is_ascii(&self) -> bool {
944944
*self as u32 <= 0x7F
@@ -966,7 +966,7 @@ impl char {
966966
///
967967
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase
968968
/// [`to_uppercase`]: #method.to_uppercase
969-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
969+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
970970
#[inline]
971971
pub fn to_ascii_uppercase(&self) -> char {
972972
if self.is_ascii() {
@@ -998,7 +998,7 @@ impl char {
998998
///
999999
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase
10001000
/// [`to_lowercase`]: #method.to_lowercase
1001-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1001+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
10021002
#[inline]
10031003
pub fn to_ascii_lowercase(&self) -> char {
10041004
if self.is_ascii() {
@@ -1023,7 +1023,7 @@ impl char {
10231023
/// assert!(upper_a.eq_ignore_ascii_case(&upper_a));
10241024
/// assert!(!upper_a.eq_ignore_ascii_case(&lower_z));
10251025
/// ```
1026-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1026+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
10271027
#[inline]
10281028
pub fn eq_ignore_ascii_case(&self, other: &char) -> bool {
10291029
self.to_ascii_lowercase() == other.to_ascii_lowercase()
@@ -1048,7 +1048,7 @@ impl char {
10481048
/// ```
10491049
///
10501050
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
1051-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1051+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
10521052
#[inline]
10531053
pub fn make_ascii_uppercase(&mut self) {
10541054
*self = self.to_ascii_uppercase();
@@ -1073,7 +1073,7 @@ impl char {
10731073
/// ```
10741074
///
10751075
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
1076-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1076+
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
10771077
#[inline]
10781078
pub fn make_ascii_lowercase(&mut self) {
10791079
*self = self.to_ascii_lowercase();

0 commit comments

Comments
 (0)