Rollup merge of #130713 - bjoernager:const-char-make-ascii, r=Noratrieb
Mark `u8::make_ascii_uppercase` and `u8::make_ascii_lowercase` as const. Relevant tracking issue: #130698 This PR extends #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`.
This commit is contained in:
commit
8bb69b1861
@ -1279,7 +1279,7 @@ pub const fn eq_ignore_ascii_case(&self, other: &char) -> bool {
|
||||
///
|
||||
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")]
|
||||
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
|
||||
#[inline]
|
||||
pub const fn make_ascii_uppercase(&mut self) {
|
||||
*self = self.to_ascii_uppercase();
|
||||
@ -1305,7 +1305,7 @@ pub const fn make_ascii_uppercase(&mut self) {
|
||||
///
|
||||
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")]
|
||||
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
|
||||
#[inline]
|
||||
pub const fn make_ascii_lowercase(&mut self) {
|
||||
*self = self.to_ascii_lowercase();
|
||||
|
@ -624,8 +624,9 @@ pub const fn eq_ignore_ascii_case(&self, other: &u8) -> bool {
|
||||
///
|
||||
/// [`to_ascii_uppercase`]: Self::to_ascii_uppercase
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
|
||||
#[inline]
|
||||
pub fn make_ascii_uppercase(&mut self) {
|
||||
pub const fn make_ascii_uppercase(&mut self) {
|
||||
*self = self.to_ascii_uppercase();
|
||||
}
|
||||
|
||||
@ -649,8 +650,9 @@ pub fn make_ascii_uppercase(&mut self) {
|
||||
///
|
||||
/// [`to_ascii_lowercase`]: Self::to_ascii_lowercase
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")]
|
||||
#[inline]
|
||||
pub fn make_ascii_lowercase(&mut self) {
|
||||
pub const fn make_ascii_lowercase(&mut self) {
|
||||
*self = self.to_ascii_lowercase();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user