blob: e8d659f9c5d8d2c29e7a23abb77e4b2d8f69e335 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
error: transmute from a reference to a reference
--> tests/ui/transmute_ref_to_ref.rs:9:39
|
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
--> tests/ui/transmute_ref_to_ref.rs:3:9
|
LL | #![deny(clippy::transmute_ptr_to_ptr)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: transmute from a reference to a reference
--> tests/ui/transmute_ref_to_ref.rs:13:33
|
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
--> tests/ui/transmute_ref_to_ref.rs:17:42
|
LL | let alt_slice: &[u32] = unsafe { std::mem::transmute(bytes) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(bytes as *const [u8] as *const [u32])`
error: aborting due to 3 previous errors
|