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.
This commit is contained in:
parent
da57580736
commit
259c125267
8 changed files with 88 additions and 40 deletions
|
@ -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)]
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -2396,6 +2396,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2416,7 +2418,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false; }
|
||||
|
@ -2432,6 +2434,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2452,7 +2456,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false }
|
||||
|
@ -2468,6 +2472,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2488,7 +2494,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false }
|
||||
|
@ -2507,6 +2513,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2527,7 +2535,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false }
|
||||
|
@ -2543,6 +2551,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2563,7 +2573,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false }
|
||||
|
@ -2582,6 +2592,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2602,7 +2614,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false }
|
||||
|
@ -2622,6 +2634,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2642,7 +2656,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false }
|
||||
|
@ -2658,6 +2672,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2678,7 +2694,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false; }
|
||||
|
@ -2711,6 +2727,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2731,7 +2749,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false; }
|
||||
|
@ -2749,6 +2767,8 @@ impl u8 {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// let uppercase_a = b'A';
|
||||
/// let uppercase_g = b'G';
|
||||
/// let a = b'a';
|
||||
|
@ -2769,7 +2789,7 @@ impl u8 {
|
|||
/// 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 {
|
||||
if *self >= 0x80 { return false; }
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
html_playground_url = "https://play.rust-lang.org/")]
|
||||
#![deny(warnings)]
|
||||
|
||||
#![feature(ascii_ctype)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(box_syntax)]
|
||||
|
|
|
@ -244,6 +244,7 @@
|
|||
#![feature(allow_internal_unstable)]
|
||||
#![feature(align_offset)]
|
||||
#![feature(array_error_internals)]
|
||||
#![feature(ascii_ctype)]
|
||||
#![feature(asm)]
|
||||
#![feature(attr_literals)]
|
||||
#![feature(box_syntax)]
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#![deny(warnings)]
|
||||
#![no_std]
|
||||
|
||||
#![feature(ascii_ctype)]
|
||||
#![feature(core_char_ext)]
|
||||
#![feature(str_internals)]
|
||||
#![feature(decode_utf8)]
|
||||
|
|
Loading…
Add table
Reference in a new issue