We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 722d284 commit 0d3bf7fCopy full SHA for 0d3bf7f
library/core/src/char/convert.rs
@@ -21,6 +21,7 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
21
/// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`].
22
#[inline]
23
#[must_use]
24
+#[cfg_attr(not(bootstrap), allow(redundant_transmutation))]
25
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {
26
// SAFETY: the caller must guarantee that `i` is a valid char value.
27
unsafe {
@@ -247,7 +248,7 @@ const fn char_try_from_u32(i: u32) -> Result<char, CharTryFromError> {
247
248
Err(CharTryFromError(()))
249
} else {
250
// SAFETY: checked that it's a legal unicode value
- Ok(unsafe { transmute(i) })
251
+ Ok(unsafe { char::from_u32_unchecked(i) })
252
}
253
254
0 commit comments