Skip to content

Commit 259c125

Browse files
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.
1 parent da57580 commit 259c125

File tree

8 files changed

+88
-40
lines changed

8 files changed

+88
-40
lines changed

src/liballoc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
#![cfg_attr(not(test), feature(generator_trait))]
8484
#![cfg_attr(test, feature(rand, test))]
8585
#![feature(allow_internal_unstable)]
86+
#![feature(ascii_ctype)]
8687
#![feature(box_patterns)]
8788
#![feature(box_syntax)]
8889
#![feature(cfg_target_has_atomic)]

src/liballoc/slice.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1631,23 +1631,23 @@ impl [u8] {
16311631
///
16321632
/// - U+0041 'A' ... U+005A 'Z', or
16331633
/// - U+0061 'a' ... U+007A 'z'.
1634-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1634+
#[unstable(feature = "ascii_ctype", issue = "39658")]
16351635
#[inline]
16361636
pub fn is_ascii_alphabetic(&self) -> bool {
16371637
self.iter().all(|b| b.is_ascii_alphabetic())
16381638
}
16391639

16401640
/// Checks if all bytes of this slice are ASCII uppercase characters:
16411641
/// U+0041 'A' ... U+005A 'Z'.
1642-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1642+
#[unstable(feature = "ascii_ctype", issue = "39658")]
16431643
#[inline]
16441644
pub fn is_ascii_uppercase(&self) -> bool {
16451645
self.iter().all(|b| b.is_ascii_uppercase())
16461646
}
16471647

16481648
/// Checks if all bytes of this slice are ASCII lowercase characters:
16491649
/// U+0061 'a' ... U+007A 'z'.
1650-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1650+
#[unstable(feature = "ascii_ctype", issue = "39658")]
16511651
#[inline]
16521652
pub fn is_ascii_lowercase(&self) -> bool {
16531653
self.iter().all(|b| b.is_ascii_lowercase())
@@ -1658,15 +1658,15 @@ impl [u8] {
16581658
/// - U+0041 'A' ... U+005A 'Z', or
16591659
/// - U+0061 'a' ... U+007A 'z', or
16601660
/// - U+0030 '0' ... U+0039 '9'.
1661-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1661+
#[unstable(feature = "ascii_ctype", issue = "39658")]
16621662
#[inline]
16631663
pub fn is_ascii_alphanumeric(&self) -> bool {
16641664
self.iter().all(|b| b.is_ascii_alphanumeric())
16651665
}
16661666

16671667
/// Checks if all bytes of this slice are ASCII decimal digit:
16681668
/// U+0030 '0' ... U+0039 '9'.
1669-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1669+
#[unstable(feature = "ascii_ctype", issue = "39658")]
16701670
#[inline]
16711671
pub fn is_ascii_digit(&self) -> bool {
16721672
self.iter().all(|b| b.is_ascii_digit())
@@ -1677,7 +1677,7 @@ impl [u8] {
16771677
/// - U+0030 '0' ... U+0039 '9', or
16781678
/// - U+0041 'A' ... U+0046 'F', or
16791679
/// - U+0061 'a' ... U+0066 'f'.
1680-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1680+
#[unstable(feature = "ascii_ctype", issue = "39658")]
16811681
#[inline]
16821682
pub fn is_ascii_hexdigit(&self) -> bool {
16831683
self.iter().all(|b| b.is_ascii_hexdigit())
@@ -1689,15 +1689,15 @@ impl [u8] {
16891689
/// - U+003A ... U+0040 `: ; < = > ? @`, or
16901690
/// - U+005B ... U+0060 `[ \\ ] ^ _ \``, or
16911691
/// - U+007B ... U+007E `{ | } ~`
1692-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1692+
#[unstable(feature = "ascii_ctype", issue = "39658")]
16931693
#[inline]
16941694
pub fn is_ascii_punctuation(&self) -> bool {
16951695
self.iter().all(|b| b.is_ascii_punctuation())
16961696
}
16971697

16981698
/// Checks if all bytes of this slice are ASCII graphic characters:
16991699
/// U+0021 '@' ... U+007E '~'.
1700-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1700+
#[unstable(feature = "ascii_ctype", issue = "39658")]
17011701
#[inline]
17021702
pub fn is_ascii_graphic(&self) -> bool {
17031703
self.iter().all(|b| b.is_ascii_graphic())
@@ -1722,7 +1722,7 @@ impl [u8] {
17221722
/// [infra-aw]: https://infra.spec.whatwg.org/#ascii-whitespace
17231723
/// [pct]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01
17241724
/// [bfs]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05
1725-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1725+
#[unstable(feature = "ascii_ctype", issue = "39658")]
17261726
#[inline]
17271727
pub fn is_ascii_whitespace(&self) -> bool {
17281728
self.iter().all(|b| b.is_ascii_whitespace())
@@ -1735,7 +1735,7 @@ impl [u8] {
17351735
///
17361736
/// Note that most ASCII whitespace characters are control
17371737
/// characters, but SPACE is not.
1738-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
1738+
#[unstable(feature = "ascii_ctype", issue = "39658")]
17391739
#[inline]
17401740
pub fn is_ascii_control(&self) -> bool {
17411741
self.iter().all(|b| b.is_ascii_control())

src/liballoc/str.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,7 @@ impl str {
22052205
///
22062206
/// - U+0041 'A' ... U+005A 'Z', or
22072207
/// - U+0061 'a' ... U+007A 'z'.
2208-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2208+
#[unstable(feature = "ascii_ctype", issue = "39658")]
22092209
#[inline]
22102210
pub fn is_ascii_alphabetic(&self) -> bool {
22112211
self.bytes().all(|b| b.is_ascii_alphabetic())
@@ -2217,6 +2217,8 @@ impl str {
22172217
/// # Example
22182218
///
22192219
/// ```
2220+
/// #![feature(ascii_ctype)]
2221+
///
22202222
/// // Only ascii uppercase characters
22212223
/// assert!("HELLO".is_ascii_uppercase());
22222224
///
@@ -2226,7 +2228,7 @@ impl str {
22262228
/// // While all characters are uppercase, 'Ü' is not ascii
22272229
/// assert!(!"TSCHÜSS".is_ascii_uppercase());
22282230
/// ```
2229-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2231+
#[unstable(feature = "ascii_ctype", issue = "39658")]
22302232
#[inline]
22312233
pub fn is_ascii_uppercase(&self) -> bool {
22322234
self.bytes().all(|b| b.is_ascii_uppercase())
@@ -2238,6 +2240,8 @@ impl str {
22382240
/// # Example
22392241
///
22402242
/// ```
2243+
/// #![feature(ascii_ctype)]
2244+
///
22412245
/// // Only ascii uppercase characters
22422246
/// assert!("hello".is_ascii_lowercase());
22432247
///
@@ -2247,7 +2251,7 @@ impl str {
22472251
/// // While all characters are lowercase, 'Ü' is not ascii
22482252
/// assert!(!"tschüss".is_ascii_lowercase());
22492253
/// ```
2250-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2254+
#[unstable(feature = "ascii_ctype", issue = "39658")]
22512255
#[inline]
22522256
pub fn is_ascii_lowercase(&self) -> bool {
22532257
self.bytes().all(|b| b.is_ascii_lowercase())
@@ -2259,15 +2263,15 @@ impl str {
22592263
/// - U+0041 'A' ... U+005A 'Z', or
22602264
/// - U+0061 'a' ... U+007A 'z', or
22612265
/// - U+0030 '0' ... U+0039 '9'.
2262-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2266+
#[unstable(feature = "ascii_ctype", issue = "39658")]
22632267
#[inline]
22642268
pub fn is_ascii_alphanumeric(&self) -> bool {
22652269
self.bytes().all(|b| b.is_ascii_alphanumeric())
22662270
}
22672271

22682272
/// Checks if all characters of this string are ASCII decimal digit:
22692273
/// U+0030 '0' ... U+0039 '9'.
2270-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2274+
#[unstable(feature = "ascii_ctype", issue = "39658")]
22712275
#[inline]
22722276
pub fn is_ascii_digit(&self) -> bool {
22732277
self.bytes().all(|b| b.is_ascii_digit())
@@ -2278,7 +2282,7 @@ impl str {
22782282
/// - U+0030 '0' ... U+0039 '9', or
22792283
/// - U+0041 'A' ... U+0046 'F', or
22802284
/// - U+0061 'a' ... U+0066 'f'.
2281-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2285+
#[unstable(feature = "ascii_ctype", issue = "39658")]
22822286
#[inline]
22832287
pub fn is_ascii_hexdigit(&self) -> bool {
22842288
self.bytes().all(|b| b.is_ascii_hexdigit())
@@ -2291,15 +2295,15 @@ impl str {
22912295
/// - U+003A ... U+0040 `: ; < = > ? @`, or
22922296
/// - U+005B ... U+0060 `[ \\ ] ^ _ \``, or
22932297
/// - U+007B ... U+007E `{ | } ~`
2294-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2298+
#[unstable(feature = "ascii_ctype", issue = "39658")]
22952299
#[inline]
22962300
pub fn is_ascii_punctuation(&self) -> bool {
22972301
self.bytes().all(|b| b.is_ascii_punctuation())
22982302
}
22992303

23002304
/// Checks if all characters of this string are ASCII graphic characters:
23012305
/// U+0021 '@' ... U+007E '~'.
2302-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2306+
#[unstable(feature = "ascii_ctype", issue = "39658")]
23032307
#[inline]
23042308
pub fn is_ascii_graphic(&self) -> bool {
23052309
self.bytes().all(|b| b.is_ascii_graphic())
@@ -2324,7 +2328,7 @@ impl str {
23242328
/// [infra-aw]: https://infra.spec.whatwg.org/#ascii-whitespace
23252329
/// [pct]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01
23262330
/// [bfs]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05
2327-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2331+
#[unstable(feature = "ascii_ctype", issue = "39658")]
23282332
#[inline]
23292333
pub fn is_ascii_whitespace(&self) -> bool {
23302334
self.bytes().all(|b| b.is_ascii_whitespace())
@@ -2337,7 +2341,7 @@ impl str {
23372341
///
23382342
/// Note that most ASCII whitespace characters are control
23392343
/// characters, but SPACE is not.
2340-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2344+
#[unstable(feature = "ascii_ctype", issue = "39658")]
23412345
#[inline]
23422346
pub fn is_ascii_control(&self) -> bool {
23432347
self.bytes().all(|b| b.is_ascii_control())

src/libcore/num/mod.rs

+30-10
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,8 @@ impl u8 {
23962396
/// # Examples
23972397
///
23982398
/// ```
2399+
/// #![feature(ascii_ctype)]
2400+
///
23992401
/// let uppercase_a = b'A';
24002402
/// let uppercase_g = b'G';
24012403
/// let a = b'a';
@@ -2416,7 +2418,7 @@ impl u8 {
24162418
/// assert!(!lf.is_ascii_alphabetic());
24172419
/// assert!(!esc.is_ascii_alphabetic());
24182420
/// ```
2419-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2421+
#[unstable(feature = "ascii_ctype", issue = "39658")]
24202422
#[inline]
24212423
pub fn is_ascii_alphabetic(&self) -> bool {
24222424
if *self >= 0x80 { return false; }
@@ -2432,6 +2434,8 @@ impl u8 {
24322434
/// # Examples
24332435
///
24342436
/// ```
2437+
/// #![feature(ascii_ctype)]
2438+
///
24352439
/// let uppercase_a = b'A';
24362440
/// let uppercase_g = b'G';
24372441
/// let a = b'a';
@@ -2452,7 +2456,7 @@ impl u8 {
24522456
/// assert!(!lf.is_ascii_uppercase());
24532457
/// assert!(!esc.is_ascii_uppercase());
24542458
/// ```
2455-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2459+
#[unstable(feature = "ascii_ctype", issue = "39658")]
24562460
#[inline]
24572461
pub fn is_ascii_uppercase(&self) -> bool {
24582462
if *self >= 0x80 { return false }
@@ -2468,6 +2472,8 @@ impl u8 {
24682472
/// # Examples
24692473
///
24702474
/// ```
2475+
/// #![feature(ascii_ctype)]
2476+
///
24712477
/// let uppercase_a = b'A';
24722478
/// let uppercase_g = b'G';
24732479
/// let a = b'a';
@@ -2488,7 +2494,7 @@ impl u8 {
24882494
/// assert!(!lf.is_ascii_lowercase());
24892495
/// assert!(!esc.is_ascii_lowercase());
24902496
/// ```
2491-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2497+
#[unstable(feature = "ascii_ctype", issue = "39658")]
24922498
#[inline]
24932499
pub fn is_ascii_lowercase(&self) -> bool {
24942500
if *self >= 0x80 { return false }
@@ -2507,6 +2513,8 @@ impl u8 {
25072513
/// # Examples
25082514
///
25092515
/// ```
2516+
/// #![feature(ascii_ctype)]
2517+
///
25102518
/// let uppercase_a = b'A';
25112519
/// let uppercase_g = b'G';
25122520
/// let a = b'a';
@@ -2527,7 +2535,7 @@ impl u8 {
25272535
/// assert!(!lf.is_ascii_alphanumeric());
25282536
/// assert!(!esc.is_ascii_alphanumeric());
25292537
/// ```
2530-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2538+
#[unstable(feature = "ascii_ctype", issue = "39658")]
25312539
#[inline]
25322540
pub fn is_ascii_alphanumeric(&self) -> bool {
25332541
if *self >= 0x80 { return false }
@@ -2543,6 +2551,8 @@ impl u8 {
25432551
/// # Examples
25442552
///
25452553
/// ```
2554+
/// #![feature(ascii_ctype)]
2555+
///
25462556
/// let uppercase_a = b'A';
25472557
/// let uppercase_g = b'G';
25482558
/// let a = b'a';
@@ -2563,7 +2573,7 @@ impl u8 {
25632573
/// assert!(!lf.is_ascii_digit());
25642574
/// assert!(!esc.is_ascii_digit());
25652575
/// ```
2566-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2576+
#[unstable(feature = "ascii_ctype", issue = "39658")]
25672577
#[inline]
25682578
pub fn is_ascii_digit(&self) -> bool {
25692579
if *self >= 0x80 { return false }
@@ -2582,6 +2592,8 @@ impl u8 {
25822592
/// # Examples
25832593
///
25842594
/// ```
2595+
/// #![feature(ascii_ctype)]
2596+
///
25852597
/// let uppercase_a = b'A';
25862598
/// let uppercase_g = b'G';
25872599
/// let a = b'a';
@@ -2602,7 +2614,7 @@ impl u8 {
26022614
/// assert!(!lf.is_ascii_hexdigit());
26032615
/// assert!(!esc.is_ascii_hexdigit());
26042616
/// ```
2605-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2617+
#[unstable(feature = "ascii_ctype", issue = "39658")]
26062618
#[inline]
26072619
pub fn is_ascii_hexdigit(&self) -> bool {
26082620
if *self >= 0x80 { return false }
@@ -2622,6 +2634,8 @@ impl u8 {
26222634
/// # Examples
26232635
///
26242636
/// ```
2637+
/// #![feature(ascii_ctype)]
2638+
///
26252639
/// let uppercase_a = b'A';
26262640
/// let uppercase_g = b'G';
26272641
/// let a = b'a';
@@ -2642,7 +2656,7 @@ impl u8 {
26422656
/// assert!(!lf.is_ascii_punctuation());
26432657
/// assert!(!esc.is_ascii_punctuation());
26442658
/// ```
2645-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2659+
#[unstable(feature = "ascii_ctype", issue = "39658")]
26462660
#[inline]
26472661
pub fn is_ascii_punctuation(&self) -> bool {
26482662
if *self >= 0x80 { return false }
@@ -2658,6 +2672,8 @@ impl u8 {
26582672
/// # Examples
26592673
///
26602674
/// ```
2675+
/// #![feature(ascii_ctype)]
2676+
///
26612677
/// let uppercase_a = b'A';
26622678
/// let uppercase_g = b'G';
26632679
/// let a = b'a';
@@ -2678,7 +2694,7 @@ impl u8 {
26782694
/// assert!(!lf.is_ascii_graphic());
26792695
/// assert!(!esc.is_ascii_graphic());
26802696
/// ```
2681-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2697+
#[unstable(feature = "ascii_ctype", issue = "39658")]
26822698
#[inline]
26832699
pub fn is_ascii_graphic(&self) -> bool {
26842700
if *self >= 0x80 { return false; }
@@ -2711,6 +2727,8 @@ impl u8 {
27112727
/// # Examples
27122728
///
27132729
/// ```
2730+
/// #![feature(ascii_ctype)]
2731+
///
27142732
/// let uppercase_a = b'A';
27152733
/// let uppercase_g = b'G';
27162734
/// let a = b'a';
@@ -2731,7 +2749,7 @@ impl u8 {
27312749
/// assert!(lf.is_ascii_whitespace());
27322750
/// assert!(!esc.is_ascii_whitespace());
27332751
/// ```
2734-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2752+
#[unstable(feature = "ascii_ctype", issue = "39658")]
27352753
#[inline]
27362754
pub fn is_ascii_whitespace(&self) -> bool {
27372755
if *self >= 0x80 { return false; }
@@ -2749,6 +2767,8 @@ impl u8 {
27492767
/// # Examples
27502768
///
27512769
/// ```
2770+
/// #![feature(ascii_ctype)]
2771+
///
27522772
/// let uppercase_a = b'A';
27532773
/// let uppercase_g = b'G';
27542774
/// let a = b'a';
@@ -2769,7 +2789,7 @@ impl u8 {
27692789
/// assert!(lf.is_ascii_control());
27702790
/// assert!(esc.is_ascii_control());
27712791
/// ```
2772-
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2792+
#[unstable(feature = "ascii_ctype", issue = "39658")]
27732793
#[inline]
27742794
pub fn is_ascii_control(&self) -> bool {
27752795
if *self >= 0x80 { return false; }

src/librustdoc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
html_playground_url = "https://play.rust-lang.org/")]
1515
#![deny(warnings)]
1616

17+
#![feature(ascii_ctype)]
1718
#![feature(rustc_private)]
1819
#![feature(box_patterns)]
1920
#![feature(box_syntax)]

0 commit comments

Comments
 (0)