Skip to content

Commit eeab9d4

Browse files
bjoernagerdtolnay
authored andcommitted
Stabilise 'const_make_ascii'
1 parent ecb3830 commit eeab9d4

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

core/src/char/methods.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,9 @@ impl char {
12821282
///
12831283
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
12841284
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
1285-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
1285+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
12861286
#[inline]
1287+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
12871288
pub const fn make_ascii_uppercase(&mut self) {
12881289
*self = self.to_ascii_uppercase();
12891290
}
@@ -1308,8 +1309,9 @@ impl char {
13081309
///
13091310
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
13101311
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
1311-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
1312+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
13121313
#[inline]
1314+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
13131315
pub const fn make_ascii_lowercase(&mut self) {
13141316
*self = self.to_ascii_lowercase();
13151317
}

core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
#![feature(const_heap)]
126126
#![feature(const_index_range_slice_index)]
127127
#![feature(const_likely)]
128-
#![feature(const_make_ascii)]
129128
#![feature(const_nonnull_new)]
130129
#![feature(const_num_midpoint)]
131130
#![feature(const_option_ext)]

core/src/num/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,9 @@ impl u8 {
624624
///
625625
/// [`to_ascii_uppercase`]: Self::to_ascii_uppercase
626626
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
627-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
627+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
628628
#[inline]
629+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
629630
pub const fn make_ascii_uppercase(&mut self) {
630631
*self = self.to_ascii_uppercase();
631632
}
@@ -650,8 +651,9 @@ impl u8 {
650651
///
651652
/// [`to_ascii_lowercase`]: Self::to_ascii_lowercase
652653
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
653-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
654+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
654655
#[inline]
656+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
655657
pub const fn make_ascii_lowercase(&mut self) {
656658
*self = self.to_ascii_lowercase();
657659
}

core/src/slice/ascii.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ impl [u8] {
6767
///
6868
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
6969
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
70-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
70+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
7171
#[inline]
72+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
7273
pub const fn make_ascii_uppercase(&mut self) {
7374
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
7475
let mut i = 0;
@@ -89,8 +90,9 @@ impl [u8] {
8990
///
9091
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
9192
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
92-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
93+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
9394
#[inline]
95+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
9496
pub const fn make_ascii_lowercase(&mut self) {
9597
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
9698
let mut i = 0;

core/src/str/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2475,8 +2475,9 @@ impl str {
24752475
/// assert_eq!("GRüßE, JüRGEN ❤", s);
24762476
/// ```
24772477
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
2478-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
2478+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
24792479
#[inline]
2480+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
24802481
pub const fn make_ascii_uppercase(&mut self) {
24812482
// SAFETY: changing ASCII letters only does not invalidate UTF-8.
24822483
let me = unsafe { self.as_bytes_mut() };
@@ -2503,8 +2504,9 @@ impl str {
25032504
/// assert_eq!("grÜße, jÜrgen ❤", s);
25042505
/// ```
25052506
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
2506-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
2507+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
25072508
#[inline]
2509+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
25082510
pub const fn make_ascii_lowercase(&mut self) {
25092511
// SAFETY: changing ASCII letters only does not invalidate UTF-8.
25102512
let me = unsafe { self.as_bytes_mut() };

0 commit comments

Comments
 (0)