2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `u8` to a `NonZero<u8>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:19:35
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<u8> = unsafe { std::mem::transmute(int_u8) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u8)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::transmute-int-to-non-zero` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::transmute_int_to_non_zero)]`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `u16` to a `NonZero<u16>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:22:36
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<u16> = unsafe { std::mem::transmute(int_u16) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u16)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `u32` to a `NonZero<u32>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:24:36
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<u32> = unsafe { std::mem::transmute(int_u32) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u32)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `u64` to a `NonZero<u64>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:26:36
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<u64> = unsafe { std::mem::transmute(int_u64) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u64)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `u128` to a `NonZero<u128>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:28:37
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<u128> = unsafe { std::mem::transmute(int_u128) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u128)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `i8` to a `NonZero<i8>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:31:35
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<i8> = unsafe { std::mem::transmute(int_i8) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i8)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `i16` to a `NonZero<i16>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:33:36
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<i16> = unsafe { std::mem::transmute(int_i16) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i16)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `i32` to a `NonZero<i32>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:35:36
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<i32> = unsafe { std::mem::transmute(int_i32) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i32)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `i64` to a `NonZero<i64>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:37:36
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<i64> = unsafe { std::mem::transmute(int_i64) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i64)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
error: transmute from a `i128` to a `NonZero<i128>`
|
|
|
|
--> tests/ui/transmute_int_to_non_zero.rs:39:37
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
2024-04-23 14:15:33 -05:00
|
|
|
LL | let _: NonZero<i128> = unsafe { std::mem::transmute(int_i128) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i128)`
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
|
|
error: aborting due to 10 previous errors
|
|
|
|
|