From 6aef5e3b2e1112c78aa20ab687959a4025529138 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Thu, 30 Nov 2017 11:20:11 -0800 Subject: [PATCH] Mark ascii methods on primitive types stable in 1.23.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. --- src/liballoc/slice.rs | 12 ++++++------ src/liballoc/str.rs | 12 ++++++------ src/libcore/num/mod.rs | 12 ++++++------ src/libstd_unicode/char.rs | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index ac815629dcf..18bb13d847a 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -1630,7 +1630,7 @@ impl [T] { #[cfg(not(test))] impl [u8] { /// Checks if all bytes in this slice are within the ASCII range. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn is_ascii(&self) -> bool { self.iter().all(|b| b.is_ascii()) @@ -1645,7 +1645,7 @@ impl [u8] { /// To uppercase the value in-place, use [`make_ascii_uppercase`]. /// /// [`make_ascii_uppercase`]: #method.make_ascii_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_uppercase(&self) -> Vec { let mut me = self.to_vec(); @@ -1662,7 +1662,7 @@ impl [u8] { /// To lowercase the value in-place, use [`make_ascii_lowercase`]. /// /// [`make_ascii_lowercase`]: #method.make_ascii_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_lowercase(&self) -> Vec { let mut me = self.to_vec(); @@ -1674,7 +1674,7 @@ impl [u8] { /// /// Same as `to_ascii_lowercase(a) == to_ascii_lowercase(b)`, /// but without allocating and copying temporaries. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool { self.len() == other.len() && @@ -1692,7 +1692,7 @@ impl [u8] { /// [`to_ascii_uppercase`]. /// /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_uppercase(&mut self) { for byte in self { @@ -1709,7 +1709,7 @@ impl [u8] { /// [`to_ascii_lowercase`]. /// /// [`to_ascii_lowercase`]: #method.to_ascii_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_lowercase(&mut self) { for byte in self { diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 975ea4e1a3e..7fa872f4ded 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -2078,7 +2078,7 @@ impl str { /// assert!(ascii.is_ascii()); /// assert!(!non_ascii.is_ascii()); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn is_ascii(&self) -> bool { // We can treat each byte as character here: all multibyte characters @@ -2108,7 +2108,7 @@ impl str { /// /// [`make_ascii_uppercase`]: #method.make_ascii_uppercase /// [`to_uppercase`]: #method.to_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_uppercase(&self) -> String { let mut bytes = self.as_bytes().to_vec(); @@ -2138,7 +2138,7 @@ impl str { /// /// [`make_ascii_lowercase`]: #method.make_ascii_lowercase /// [`to_lowercase`]: #method.to_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_lowercase(&self) -> String { let mut bytes = self.as_bytes().to_vec(); @@ -2159,7 +2159,7 @@ impl str { /// assert!("Ferrös".eq_ignore_ascii_case("FERRöS")); /// assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS")); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn eq_ignore_ascii_case(&self, other: &str) -> bool { self.as_bytes().eq_ignore_ascii_case(other.as_bytes()) @@ -2174,7 +2174,7 @@ impl str { /// [`to_ascii_uppercase`]. /// /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] pub fn make_ascii_uppercase(&mut self) { let me = unsafe { self.as_bytes_mut() }; me.make_ascii_uppercase() @@ -2189,7 +2189,7 @@ impl str { /// [`to_ascii_lowercase`]. /// /// [`to_ascii_lowercase`]: #method.to_ascii_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] pub fn make_ascii_lowercase(&mut self) { let me = unsafe { self.as_bytes_mut() }; me.make_ascii_lowercase() diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 5b9dd4b1c69..0aad354a872 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -2286,7 +2286,7 @@ impl u8 { /// assert!(ascii.is_ascii()); /// assert!(!non_ascii.is_ascii()); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn is_ascii(&self) -> bool { *self & 128 == 0 @@ -2308,7 +2308,7 @@ impl u8 { /// ``` /// /// [`make_ascii_uppercase`]: #method.make_ascii_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_uppercase(&self) -> u8 { ASCII_UPPERCASE_MAP[*self as usize] @@ -2330,7 +2330,7 @@ impl u8 { /// ``` /// /// [`make_ascii_lowercase`]: #method.make_ascii_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_lowercase(&self) -> u8 { ASCII_LOWERCASE_MAP[*self as usize] @@ -2348,7 +2348,7 @@ impl u8 { /// /// assert!(lowercase_a.eq_ignore_ascii_case(&uppercase_a)); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn eq_ignore_ascii_case(&self, other: &u8) -> bool { self.to_ascii_lowercase() == other.to_ascii_lowercase() @@ -2373,7 +2373,7 @@ impl u8 { /// ``` /// /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_uppercase(&mut self) { *self = self.to_ascii_uppercase(); @@ -2398,7 +2398,7 @@ impl u8 { /// ``` /// /// [`to_ascii_lowercase`]: #method.to_ascii_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase(); diff --git a/src/libstd_unicode/char.rs b/src/libstd_unicode/char.rs index 6b573e5011b..ef11fb694ab 100644 --- a/src/libstd_unicode/char.rs +++ b/src/libstd_unicode/char.rs @@ -938,7 +938,7 @@ impl char { /// assert!(ascii.is_ascii()); /// assert!(!non_ascii.is_ascii()); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn is_ascii(&self) -> bool { *self as u32 <= 0x7F @@ -966,7 +966,7 @@ impl char { /// /// [`make_ascii_uppercase`]: #method.make_ascii_uppercase /// [`to_uppercase`]: #method.to_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_uppercase(&self) -> char { if self.is_ascii() { @@ -998,7 +998,7 @@ impl char { /// /// [`make_ascii_lowercase`]: #method.make_ascii_lowercase /// [`to_lowercase`]: #method.to_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_lowercase(&self) -> char { if self.is_ascii() { @@ -1023,7 +1023,7 @@ impl char { /// assert!(upper_a.eq_ignore_ascii_case(&upper_a)); /// assert!(!upper_a.eq_ignore_ascii_case(&lower_z)); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn eq_ignore_ascii_case(&self, other: &char) -> bool { self.to_ascii_lowercase() == other.to_ascii_lowercase() @@ -1048,7 +1048,7 @@ impl char { /// ``` /// /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_uppercase(&mut self) { *self = self.to_ascii_uppercase(); @@ -1073,7 +1073,7 @@ impl char { /// ``` /// /// [`to_ascii_lowercase`]: #method.to_ascii_lowercase - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase();