Skip to content

Commit 58c2ba5

Browse files
committed
char fix
1 parent 36854b6 commit 58c2ba5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/char/convert.rs

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
2121
/// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`].
2222
#[inline]
2323
#[must_use]
24+
#[cfg_attr(not(bootstrap), allow(redundant_transmutation))]
2425
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {
2526
// SAFETY: the caller must guarantee that `i` is a valid char value.
2627
unsafe {
@@ -229,6 +230,7 @@ impl FromStr for char {
229230
}
230231

231232
#[inline]
233+
#[cfg_attr(not(bootstrap), allow(redundant_transmutation))]
232234
const fn char_try_from_u32(i: u32) -> Result<char, CharTryFromError> {
233235
// This is an optimized version of the check
234236
// (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF),

0 commit comments

Comments
 (0)