Skip to content

Commit 028c859

Browse files
committed
Stabilise 'const_make_ascii';
1 parent a1eceec commit 028c859

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

library/core/src/char/methods.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1281,8 +1281,9 @@ impl char {
12811281
///
12821282
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
12831283
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
1284-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
1284+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
12851285
#[inline]
1286+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
12861287
pub const fn make_ascii_uppercase(&mut self) {
12871288
*self = self.to_ascii_uppercase();
12881289
}
@@ -1307,8 +1308,9 @@ impl char {
13071308
///
13081309
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
13091310
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
1310-
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
1311+
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
13111312
#[inline]
1313+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
13121314
pub const fn make_ascii_lowercase(&mut self) {
13131315
*self = self.to_ascii_lowercase();
13141316
}

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130
#![feature(const_ipv4)]
131131
#![feature(const_ipv6)]
132132
#![feature(const_likely)]
133-
#![feature(const_make_ascii)]
134133
#![feature(const_maybe_uninit_assume_init)]
135134
#![feature(const_nonnull_new)]
136135
#![feature(const_num_midpoint)]

library/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
}

library/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;

library/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)