Skip to content

Commit 776d9ef

Browse files
authored
Rollup merge of rust-lang#130713 - bjoernager:const-char-make-ascii, r=Noratrieb
Mark `u8::make_ascii_uppercase` and `u8::make_ascii_lowercase` as const. Relevant tracking issue: rust-lang#130698 This PR extends rust-lang#130697 by also marking the `make_ascii_uppercase` and `make_ascii_lowercase` methods in `u8` as const. The `const_char_make_ascii` feature gate is additionally renamed to `const_make_ascii`.
2 parents 337c634 + 474b9af commit 776d9ef

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

core/src/char/methods.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ impl char {
12791279
///
12801280
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
12811281
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
1282-
#[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")]
1282+
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
12831283
#[inline]
12841284
pub const fn make_ascii_uppercase(&mut self) {
12851285
*self = self.to_ascii_uppercase();
@@ -1305,7 +1305,7 @@ impl char {
13051305
///
13061306
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
13071307
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
1308-
#[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")]
1308+
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
13091309
#[inline]
13101310
pub const fn make_ascii_lowercase(&mut self) {
13111311
*self = self.to_ascii_lowercase();

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")]
627628
#[inline]
628-
pub fn make_ascii_uppercase(&mut self) {
629+
pub const fn make_ascii_uppercase(&mut self) {
629630
*self = self.to_ascii_uppercase();
630631
}
631632

@@ -649,8 +650,9 @@ impl u8 {
649650
///
650651
/// [`to_ascii_lowercase`]: Self::to_ascii_lowercase
651652
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
653+
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
652654
#[inline]
653-
pub fn make_ascii_lowercase(&mut self) {
655+
pub const fn make_ascii_lowercase(&mut self) {
654656
*self = self.to_ascii_lowercase();
655657
}
656658

0 commit comments

Comments
 (0)