From 966662347af2ac70cd85e84eb91e2dd4a2ef5bab Mon Sep 17 00:00:00 2001 From: bendn Date: Sun, 26 Jan 2025 12:33:58 +0700 Subject: [PATCH] char fix --- library/core/src/char/convert.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/char/convert.rs b/library/core/src/char/convert.rs index 73ab4f1e52ade..894f2614ba773 100644 --- a/library/core/src/char/convert.rs +++ b/library/core/src/char/convert.rs @@ -21,6 +21,7 @@ pub(super) const fn from_u32(i: u32) -> Option { /// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`]. #[inline] #[must_use] +#[cfg_attr(not(bootstrap), allow(redundant_transmutation))] pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char { // SAFETY: the caller must guarantee that `i` is a valid char value. unsafe { @@ -229,6 +230,7 @@ impl FromStr for char { } #[inline] +#[cfg_attr(not(bootstrap), allow(redundant_transmutation))] const fn char_try_from_u32(i: u32) -> Result { // This is an optimized version of the check // (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF),