mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
update stderr for transmutes_expressible_as_ptr_casts
This commit is contained in:
parent
fe9ad57e98
commit
a1ca12581a
1 changed files with 8 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
error: transmute from an integer to a pointer
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:18:9
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:19:9
|
||||
|
|
||||
LL | transmute::<isize, *const i32>(-1)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-1 as *const i32`
|
||||
|
@ -7,7 +7,7 @@ LL | transmute::<isize, *const i32>(-1)
|
|||
= note: `-D clippy::useless-transmute` implied by `-D warnings`
|
||||
|
||||
error: transmute from a pointer to a pointer
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:24:9
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:25:9
|
||||
|
|
||||
LL | transmute::<*const i32, *const i8>(ptr_i32)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr_i32 as *const i8`
|
||||
|
@ -15,13 +15,13 @@ LL | transmute::<*const i32, *const i8>(ptr_i32)
|
|||
= note: `-D clippy::transmute-ptr-to-ptr` implied by `-D warnings`
|
||||
|
||||
error: transmute from a pointer to a pointer
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:32:9
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:33:9
|
||||
|
|
||||
LL | transmute::<*const [i32], *const [u16]>(slice_ptr)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice_ptr as *const [u16]`
|
||||
|
||||
error: transmute from `*const i32` to `usize` which could be expressed as a pointer cast instead
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:40:9
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:41:9
|
||||
|
|
||||
LL | transmute::<*const i32, usize>(ptr_i32)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr_i32 as usize`
|
||||
|
@ -29,25 +29,25 @@ LL | transmute::<*const i32, usize>(ptr_i32)
|
|||
= note: `-D clippy::transmutes-expressible-as-ptr-casts` implied by `-D warnings`
|
||||
|
||||
error: transmute from a reference to a pointer
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:48:9
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:49:9
|
||||
|
|
||||
LL | transmute::<&[i32; 4], *const [i32; 4]>(array_ref)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `array_ref as *const [i32; 4]`
|
||||
|
||||
error: transmute from `fn(usize) -> u8 {main::foo}` to `*const usize` which could be expressed as a pointer cast instead
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:56:9
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:57:9
|
||||
|
|
||||
LL | transmute::<fn(usize) -> u8, *const usize>(foo)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `foo as *const usize`
|
||||
|
||||
error: transmute from `fn(usize) -> u8 {main::foo}` to `usize` which could be expressed as a pointer cast instead
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:62:9
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:63:9
|
||||
|
|
||||
LL | transmute::<fn(usize) -> u8, usize>(foo)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `foo as usize`
|
||||
|
||||
error: transmute from a reference to a pointer
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:75:14
|
||||
--> $DIR/transmutes_expressible_as_ptr_casts.rs:76:14
|
||||
|
|
||||
LL | unsafe { transmute::<&[i32; 1], *const u8>(in_param) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `in_param as *const [i32; 1] as *const u8`
|
||||
|
|
Loading…
Reference in a new issue