rust/tests/ui/transmute_int_to_char_no_std.stderr

18 lines
778 B
Plaintext
Raw Normal View History

error: transmute from a `u32` to a `char`
2024-02-17 06:16:29 -06:00
--> tests/ui/transmute_int_to_char_no_std.rs:16:28
|
LL | let _: char = unsafe { core::mem::transmute(0_u32) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `core::char::from_u32(0_u32).unwrap()`
|
= note: `-D clippy::transmute-int-to-char` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::transmute_int_to_char)]`
error: transmute from a `i32` to a `char`
2024-02-17 06:16:29 -06:00
--> tests/ui/transmute_int_to_char_no_std.rs:19:28
|
LL | let _: char = unsafe { core::mem::transmute(0_i32) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `core::char::from_u32(0_i32 as u32).unwrap()`
error: aborting due to 2 previous errors