diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/lib.rs | 1 | ||||
| -rw-r--r-- | src/liballoc/slice.rs | 20 | ||||
| -rw-r--r-- | src/liballoc/str.rs | 24 |
3 files changed, 25 insertions, 20 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index f654a6b5ba4..a40ed060604 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -83,6 +83,7 @@ #![cfg_attr(not(test), feature(generator_trait))] #![cfg_attr(test, feature(rand, test))] #![feature(allow_internal_unstable)] +#![feature(ascii_ctype)] #![feature(box_patterns)] #![feature(box_syntax)] #![feature(cfg_target_has_atomic)] diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 7590003a681..b41cb912fe7 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -1631,7 +1631,7 @@ impl [u8] { /// /// - U+0041 'A' ... U+005A 'Z', or /// - U+0061 'a' ... U+007A 'z'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_alphabetic(&self) -> bool { self.iter().all(|b| b.is_ascii_alphabetic()) @@ -1639,7 +1639,7 @@ impl [u8] { /// Checks if all bytes of this slice are ASCII uppercase characters: /// U+0041 'A' ... U+005A 'Z'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_uppercase(&self) -> bool { self.iter().all(|b| b.is_ascii_uppercase()) @@ -1647,7 +1647,7 @@ impl [u8] { /// Checks if all bytes of this slice are ASCII lowercase characters: /// U+0061 'a' ... U+007A 'z'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_lowercase(&self) -> bool { self.iter().all(|b| b.is_ascii_lowercase()) @@ -1658,7 +1658,7 @@ impl [u8] { /// - U+0041 'A' ... U+005A 'Z', or /// - U+0061 'a' ... U+007A 'z', or /// - U+0030 '0' ... U+0039 '9'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_alphanumeric(&self) -> bool { self.iter().all(|b| b.is_ascii_alphanumeric()) @@ -1666,7 +1666,7 @@ impl [u8] { /// Checks if all bytes of this slice are ASCII decimal digit: /// U+0030 '0' ... U+0039 '9'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_digit(&self) -> bool { self.iter().all(|b| b.is_ascii_digit()) @@ -1677,7 +1677,7 @@ impl [u8] { /// - U+0030 '0' ... U+0039 '9', or /// - U+0041 'A' ... U+0046 'F', or /// - U+0061 'a' ... U+0066 'f'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_hexdigit(&self) -> bool { self.iter().all(|b| b.is_ascii_hexdigit()) @@ -1689,7 +1689,7 @@ impl [u8] { /// - U+003A ... U+0040 `: ; < = > ? @`, or /// - U+005B ... U+0060 `[ \\ ] ^ _ \``, or /// - U+007B ... U+007E `{ | } ~` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_punctuation(&self) -> bool { self.iter().all(|b| b.is_ascii_punctuation()) @@ -1697,7 +1697,7 @@ impl [u8] { /// Checks if all bytes of this slice are ASCII graphic characters: /// U+0021 '@' ... U+007E '~'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_graphic(&self) -> bool { self.iter().all(|b| b.is_ascii_graphic()) @@ -1722,7 +1722,7 @@ impl [u8] { /// [infra-aw]: https://infra.spec.whatwg.org/#ascii-whitespace /// [pct]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01 /// [bfs]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05 - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_whitespace(&self) -> bool { self.iter().all(|b| b.is_ascii_whitespace()) @@ -1735,7 +1735,7 @@ impl [u8] { /// /// Note that most ASCII whitespace characters are control /// characters, but SPACE is not. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_control(&self) -> bool { self.iter().all(|b| b.is_ascii_control()) diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index b75ecb6ea51..5f0b4088fc0 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -2205,7 +2205,7 @@ impl str { /// /// - U+0041 'A' ... U+005A 'Z', or /// - U+0061 'a' ... U+007A 'z'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_alphabetic(&self) -> bool { self.bytes().all(|b| b.is_ascii_alphabetic()) @@ -2217,6 +2217,8 @@ impl str { /// # Example /// /// ``` + /// #![feature(ascii_ctype)] + /// /// // Only ascii uppercase characters /// assert!("HELLO".is_ascii_uppercase()); /// @@ -2226,7 +2228,7 @@ impl str { /// // While all characters are uppercase, 'Ü' is not ascii /// assert!(!"TSCHÜSS".is_ascii_uppercase()); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_uppercase(&self) -> bool { self.bytes().all(|b| b.is_ascii_uppercase()) @@ -2238,6 +2240,8 @@ impl str { /// # Example /// /// ``` + /// #![feature(ascii_ctype)] + /// /// // Only ascii uppercase characters /// assert!("hello".is_ascii_lowercase()); /// @@ -2247,7 +2251,7 @@ impl str { /// // While all characters are lowercase, 'Ü' is not ascii /// assert!(!"tschüss".is_ascii_lowercase()); /// ``` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_lowercase(&self) -> bool { self.bytes().all(|b| b.is_ascii_lowercase()) @@ -2259,7 +2263,7 @@ impl str { /// - U+0041 'A' ... U+005A 'Z', or /// - U+0061 'a' ... U+007A 'z', or /// - U+0030 '0' ... U+0039 '9'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_alphanumeric(&self) -> bool { self.bytes().all(|b| b.is_ascii_alphanumeric()) @@ -2267,7 +2271,7 @@ impl str { /// Checks if all characters of this string are ASCII decimal digit: /// U+0030 '0' ... U+0039 '9'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_digit(&self) -> bool { self.bytes().all(|b| b.is_ascii_digit()) @@ -2278,7 +2282,7 @@ impl str { /// - U+0030 '0' ... U+0039 '9', or /// - U+0041 'A' ... U+0046 'F', or /// - U+0061 'a' ... U+0066 'f'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_hexdigit(&self) -> bool { self.bytes().all(|b| b.is_ascii_hexdigit()) @@ -2291,7 +2295,7 @@ impl str { /// - U+003A ... U+0040 `: ; < = > ? @`, or /// - U+005B ... U+0060 `[ \\ ] ^ _ \``, or /// - U+007B ... U+007E `{ | } ~` - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_punctuation(&self) -> bool { self.bytes().all(|b| b.is_ascii_punctuation()) @@ -2299,7 +2303,7 @@ impl str { /// Checks if all characters of this string are ASCII graphic characters: /// U+0021 '@' ... U+007E '~'. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_graphic(&self) -> bool { self.bytes().all(|b| b.is_ascii_graphic()) @@ -2324,7 +2328,7 @@ impl str { /// [infra-aw]: https://infra.spec.whatwg.org/#ascii-whitespace /// [pct]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01 /// [bfs]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05 - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_whitespace(&self) -> bool { self.bytes().all(|b| b.is_ascii_whitespace()) @@ -2337,7 +2341,7 @@ impl str { /// /// Note that most ASCII whitespace characters are control /// characters, but SPACE is not. - #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] + #[unstable(feature = "ascii_ctype", issue = "39658")] #[inline] pub fn is_ascii_control(&self) -> bool { self.bytes().all(|b| b.is_ascii_control()) |
