2023-11-21 13:04:07 +00:00
|
|
|
error: transmute from a reference to a reference
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/transmute_ref_to_ref.rs:9:39
|
2023-11-21 13:04:07 +00:00
|
|
|
|
|
|
|
|
LL | let bools: &[bool] = unsafe { std::mem::transmute(single_u64) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(single_u64 as *const [u64] as *const [bool])`
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/transmute_ref_to_ref.rs:3:9
|
2023-11-21 13:04:07 +00:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::transmute_ptr_to_ptr)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: transmute from a reference to a reference
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/transmute_ref_to_ref.rs:12:33
|
2023-11-21 13:04:07 +00:00
|
|
|
|
|
|
|
|
LL | let b: &[u8] = unsafe { std::mem::transmute(a) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(a as *const [u32] as *const [u8])`
|
|
|
|
|
|
|
|
error: transmute from a reference to a reference
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/transmute_ref_to_ref.rs:15:42
|
2023-11-21 13:04:07 +00:00
|
|
|
|
|
2024-01-14 13:13:26 +00:00
|
|
|
LL | let alt_slice: &[u32] = unsafe { std::mem::transmute(bytes) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(bytes as *const [u8] as *const [u32])`
|
2023-11-21 13:04:07 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|