about summary refs log tree commit diff
diff options
context:
space:
mode:
authorultrabear <bearodark@gmail.com>2024-10-27 14:31:58 -0700
committerultrabear <bearodark@gmail.com>2024-10-27 14:31:58 -0700
commit66209cd9b57f9414c9b8bc826ca97c4b7d52489a (patch)
tree745d1c3b465dd50fbe2f690931e704c017ddf322
parent81d6652e741f091f4ee0b7a660120d204e0417b8 (diff)
downloadrust-66209cd9b57f9414c9b8bc826ca97c4b7d52489a.tar.gz
rust-66209cd9b57f9414c9b8bc826ca97c4b7d52489a.zip
Support `char::is_digit` in const contexts
-rw-r--r--library/core/src/char/methods.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs
index 9c667edb476..206bbf5690e 100644
--- a/library/core/src/char/methods.rs
+++ b/library/core/src/char/methods.rs
@@ -320,8 +320,9 @@ impl char {
     /// '1'.is_digit(37);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[rustc_const_unstable(feature = "const_char_is_digit", issue = "132241")]
     #[inline]
-    pub fn is_digit(self, radix: u32) -> bool {
+    pub const fn is_digit(self, radix: u32) -> bool {
         self.to_digit(radix).is_some()
     }