1 error: transmute from an integer to a pointer
2 --> $DIR/transmutes_expressible_as_ptr_casts.rs:18:9
4 LL | transmute::<isize, *const i32>(-1)
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-1 as *const i32`
7 = note: `-D clippy::useless-transmute` implied by `-D warnings`
9 error: transmute from a pointer to a pointer
10 --> $DIR/transmutes_expressible_as_ptr_casts.rs:24:9
12 LL | transmute::<*const i32, *const i8>(ptr_i32)
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr_i32 as *const i8`
15 = note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
17 error: transmute from a pointer to a pointer
18 --> $DIR/transmutes_expressible_as_ptr_casts.rs:32:9
20 LL | transmute::<*const [i32], *const [u16]>(slice_ptr)
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice_ptr as *const [u16]`
23 error: transmute from `*const i32` to `usize` which could be expressed as a pointer cast instead
24 --> $DIR/transmutes_expressible_as_ptr_casts.rs:40:9
26 LL | transmute::<*const i32, usize>(ptr_i32)
27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr_i32 as usize`
29 = note: `-D clippy::transmutes-expressible-as-ptr-casts` implied by `-D warnings`
31 error: transmute from a reference to a pointer
32 --> $DIR/transmutes_expressible_as_ptr_casts.rs:48:9
34 LL | transmute::<&[i32; 4], *const [i32; 4]>(array_ref)
35 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `array_ref as *const [i32; 4]`
37 error: transmute from `fn(usize) -> u8 {main::foo}` to `*const usize` which could be expressed as a pointer cast instead
38 --> $DIR/transmutes_expressible_as_ptr_casts.rs:56:9
40 LL | transmute::<fn(usize) -> u8, *const usize>(foo)
41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `foo as *const usize`
43 error: transmute from `fn(usize) -> u8 {main::foo}` to `usize` which could be expressed as a pointer cast instead
44 --> $DIR/transmutes_expressible_as_ptr_casts.rs:62:9
46 LL | transmute::<fn(usize) -> u8, usize>(foo)
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `foo as usize`
49 error: aborting due to 7 previous errors