about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGabriel Bjørnager Jensen <gabriel@achernar.io>2024-09-22 12:33:13 +0200
committerGabriel Bjørnager Jensen <gabriel@achernar.io>2024-09-22 14:26:29 +0200
commitbe9b3b459a0012fc83078ec4e5302b6153ceeeba (patch)
tree1ebcff9caefb619800a5b2b2f10a15e3f17dfd08
parent82d17a4db3a010caa947d49245de63a7ac14accf (diff)
downloadrust-be9b3b459a0012fc83078ec4e5302b6153ceeeba.tar.gz
rust-be9b3b459a0012fc83078ec4e5302b6153ceeeba.zip
Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'char' as const;
-rw-r--r--library/core/src/char/methods.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs
index bc5c7c32490..9d9a3b5132c 100644
--- a/library/core/src/char/methods.rs
+++ b/library/core/src/char/methods.rs
@@ -1277,8 +1277,9 @@ impl char {
     ///
     /// [`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")]
     #[inline]
-    pub fn make_ascii_uppercase(&mut self) {
+    pub const fn make_ascii_uppercase(&mut self) {
         *self = self.to_ascii_uppercase();
     }
 
@@ -1302,8 +1303,9 @@ impl char {
     ///
     /// [`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")]
     #[inline]
-    pub fn make_ascii_lowercase(&mut self) {
+    pub const fn make_ascii_lowercase(&mut self) {
         *self = self.to_ascii_lowercase();
     }