1 error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
2 --> $DIR/cast_slice_different_sizes.rs:9:13
4 LL | let b = a as *const [u8];
5 | ^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(a as *const u8, ..)`
7 = note: `#[deny(clippy::cast_slice_different_sizes)]` on by default
9 error: casting between raw pointers to `[u8]` (element size 1) and `[u32]` (element size 4) does not adjust the count
10 --> $DIR/cast_slice_different_sizes.rs:10:13
12 LL | let c = b as *const [u32];
13 | ^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(b as *const u32, ..)`
15 error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
16 --> $DIR/cast_slice_different_sizes.rs:13:16
18 LL | let loss = r_x as *const [i32] as *const [u8];
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(r_x as *const [i32] as *const u8, ..)`
21 error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
22 --> $DIR/cast_slice_different_sizes.rs:20:24
24 LL | let loss_block_1 = { r_x as *const [i32] } as *const [u8];
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts({ r_x as *const [i32] } as *const u8, ..)`
27 error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
28 --> $DIR/cast_slice_different_sizes.rs:21:24
30 LL | let loss_block_2 = {
31 | ________________________^
33 LL | | r_x as *const [i32]
34 LL | | } as *const [u8];
35 | |____________________^
37 help: replace with `ptr::slice_from_raw_parts`
39 LL ~ let loss_block_2 = core::ptr::slice_from_raw_parts({
41 LL + r_x as *const [i32]
42 LL ~ } as *const u8, ..);
45 error: casting between raw pointers to `[i32]` (element size 4) and `[u8]` (element size 1) does not adjust the count
46 --> $DIR/cast_slice_different_sizes.rs:38:27
48 LL | let long_chain_loss = r_x as *const [i32] as *const [u32] as *const [u16] as *const [i8] as *const [u8];
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(r_x as *const [i32] as *const u8, ..)`
51 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
52 --> $DIR/cast_slice_different_sizes.rs:53:36
54 LL | fn bar(x: *mut [u16]) -> *mut [u8] {
55 | ____________________________________^
58 | |_^ help: replace with `ptr::slice_from_raw_parts_mut`: `core::ptr::slice_from_raw_parts_mut(x as *mut u8, ..)`
60 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
61 --> $DIR/cast_slice_different_sizes.rs:57:36
63 LL | fn uwu(x: *mut [u16]) -> *mut [u8] {
64 | ____________________________________^
67 | |_^ help: replace with `ptr::slice_from_raw_parts_mut`: `core::ptr::slice_from_raw_parts_mut(x as *mut u8, ..)`
69 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
70 --> $DIR/cast_slice_different_sizes.rs:61:37
72 LL | fn bar2(x: *mut [u16]) -> *mut [u8] {
73 | _____________________________________^
76 | |_^ help: replace with `ptr::slice_from_raw_parts_mut`: `core::ptr::slice_from_raw_parts_mut(x as *mut u8, ..)`
78 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
79 --> $DIR/cast_slice_different_sizes.rs:66:39
81 LL | fn bar3(x: *mut [u16]) -> *const [u8] {
82 | _______________________________________^
85 | |_^ help: replace with `ptr::slice_from_raw_parts`: `core::ptr::slice_from_raw_parts(x as *const u8, ..)`
87 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
88 --> $DIR/cast_slice_different_sizes.rs:71:39
90 LL | fn bar4(x: *const [u16]) -> *mut [u8] {
91 | _______________________________________^
94 | |_^ help: replace with `ptr::slice_from_raw_parts_mut`: `core::ptr::slice_from_raw_parts_mut(x as *mut u8, ..)`
96 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
97 --> $DIR/cast_slice_different_sizes.rs:76:39
99 LL | fn blocks(x: *mut [u16]) -> *mut [u8] {
100 | _______________________________________^
103 | |_^ help: replace with `ptr::slice_from_raw_parts_mut`: `core::ptr::slice_from_raw_parts_mut(({ x }) as *mut u8, ..)`
105 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
106 --> $DIR/cast_slice_different_sizes.rs:80:44
108 LL | fn more_blocks(x: *mut [u16]) -> *mut [u8] {
109 | ____________________________________________^
110 LL | | { ({ x }) as _ }
112 | |_^ help: replace with `ptr::slice_from_raw_parts_mut`: `core::ptr::slice_from_raw_parts_mut(({ x }) as *mut u8, ..)`
114 error: casting between raw pointers to `[u16]` (element size 2) and `[u8]` (element size 1) does not adjust the count
115 --> $DIR/cast_slice_different_sizes.rs:81:5
117 LL | { ({ x }) as _ }
118 | ^^^^^^^^^^^^^^^^ help: replace with `ptr::slice_from_raw_parts_mut`: `core::ptr::slice_from_raw_parts_mut(({ x }) as *mut u8, ..)`
120 error: aborting due to 14 previous errors