From 259c125267fb8334ae7f70f4e1d1c2e0d9a56d59 Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Tue, 3 Oct 2017 17:39:31 +0200 Subject: Mark several ascii methods as unstable again We don't want to stabilize them now already. The goal of this set of commits is just to add inherent methods to the four types. Stabilizing all of those methods can be done later. --- src/libstd_unicode/char.rs | 40 ++++++++++++++++++++++++++++++---------- src/libstd_unicode/lib.rs | 1 + 2 files changed, 31 insertions(+), 10 deletions(-) (limited to 'src/libstd_unicode') diff --git a/src/libstd_unicode/char.rs b/src/libstd_unicode/char.rs index a9f46f17790..c012bdcb6db 100644 --- a/src/libstd_unicode/char.rs +++ b/src/libstd_unicode/char.rs @@ -1084,6 +1084,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1104,7 +1106,7 @@ impl char { /// assert!(!lf.is_ascii_alphabetic()); /// assert!(!esc.is_ascii_alphabetic()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_alphabetic() @@ -1116,6 +1118,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1136,7 +1140,7 @@ impl char { /// assert!(!lf.is_ascii_uppercase()); /// assert!(!esc.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.is_ascii() && (*self as u8).is_ascii_uppercase() @@ -1148,6 +1152,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1168,7 +1174,7 @@ impl char { /// assert!(!lf.is_ascii_lowercase()); /// assert!(!esc.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.is_ascii() && (*self as u8).is_ascii_lowercase() @@ -1183,6 +1189,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1203,7 +1211,7 @@ impl char { /// assert!(!lf.is_ascii_alphanumeric()); /// assert!(!esc.is_ascii_alphanumeric()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_alphanumeric() @@ -1215,6 +1223,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1235,7 +1245,7 @@ impl char { /// assert!(!lf.is_ascii_digit()); /// assert!(!esc.is_ascii_digit()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_digit() @@ -1250,6 +1260,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1270,7 +1282,7 @@ impl char { /// assert!(!lf.is_ascii_hexdigit()); /// assert!(!esc.is_ascii_hexdigit()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_hexdigit() @@ -1286,6 +1298,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1306,7 +1320,7 @@ impl char { /// assert!(!lf.is_ascii_punctuation()); /// assert!(!esc.is_ascii_punctuation()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_punctuation() @@ -1318,6 +1332,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1338,7 +1354,7 @@ impl char { /// assert!(!lf.is_ascii_graphic()); /// assert!(!esc.is_ascii_graphic()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_graphic() @@ -1367,6 +1383,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1387,7 +1405,7 @@ impl char { /// assert!(lf.is_ascii_whitespace()); /// assert!(!esc.is_ascii_whitespace()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_whitespace() @@ -1401,6 +1419,8 @@ impl char { /// # Examples /// /// ``` + /// #![feature(ascii_ctype)] + /// /// let uppercase_a = 'A'; /// let uppercase_g = 'G'; /// let a = 'a'; @@ -1421,7 +1441,7 @@ impl char { /// assert!(lf.is_ascii_control()); /// assert!(esc.is_ascii_control()); /// ``` - #[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.is_ascii() && (*self as u8).is_ascii_control() diff --git a/src/libstd_unicode/lib.rs b/src/libstd_unicode/lib.rs index e5a114caed0..65058b6554a 100644 --- a/src/libstd_unicode/lib.rs +++ b/src/libstd_unicode/lib.rs @@ -30,6 +30,7 @@ #![deny(warnings)] #![no_std] +#![feature(ascii_ctype)] #![feature(core_char_ext)] #![feature(str_internals)] #![feature(decode_utf8)] -- cgit 1.4.1-3-g733a5