Skip to content

Commit f14637b

Browse files
authored
Rollup merge of #132242 - ultrabear:const_is_digit, r=scottmcm
Support `char::is_digit` in const contexts. This PR implements [`feature(const_char_is_digit)` #132241](#132241)
2 parents a9ee1d0 + 66209cd commit f14637b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/char/methods.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ impl char {
320320
/// '1'.is_digit(37);
321321
/// ```
322322
#[stable(feature = "rust1", since = "1.0.0")]
323+
#[rustc_const_unstable(feature = "const_char_is_digit", issue = "132241")]
323324
#[inline]
324-
pub fn is_digit(self, radix: u32) -> bool {
325+
pub const fn is_digit(self, radix: u32) -> bool {
325326
self.to_digit(radix).is_some()
326327
}
327328

0 commit comments

Comments
 (0)