From 2daf076fd8345ea2db1a81f56e8182e5f4e94ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Bj=C3=B8rnager=20Jensen?= Date: Sun, 22 Sep 2024 19:54:35 +0200 Subject: [PATCH] Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'u8' as const; Rename 'const_char_make_ascii' feature gate to 'const_make_ascii'; --- library/core/src/char/methods.rs | 4 ++-- library/core/src/num/mod.rs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 9d9a3b5132c..2a0acfeacdf 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -1277,7 +1277,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(); @@ -1303,7 +1303,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(); diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index dca644ebef4..1f6e43bdba3 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -614,8 +614,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(); } @@ -639,8 +640,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(); }