mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-22 19:13:29 +00:00
18 lines
748 B
Text
18 lines
748 B
Text
|
error: transmute from a `u32` to a `char`
|
||
|
--> $DIR/transmute_int_to_char.rs:4:28
|
||
|
|
|
||
|
LL | let _: char = unsafe { std::mem::transmute(0_u32) };
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::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`
|
||
|
--> $DIR/transmute_int_to_char.rs:7:28
|
||
|
|
|
||
|
LL | let _: char = unsafe { std::mem::transmute(0_i32) };
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_i32 as u32).unwrap()`
|
||
|
|
||
|
error: aborting due to 2 previous errors
|
||
|
|