Skip to content

Commit

Permalink
generate stderr file on 32bit pointer system
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Oct 18, 2019
1 parent ee6fc1b commit bef518c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/ui/transmute_32bit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//ignore-x86_64
// ignore-64bit

#[warn(wrong_transmute)]
#[warn(clippy::wrong_transmute)]
fn main() {
unsafe {
let _: *const usize = std::mem::transmute(6.0f32);
Expand Down
31 changes: 31 additions & 0 deletions tests/ui/transmute_32bit.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
error: transmute from a `f32` to a pointer
--> $DIR/transmute_32bit.rs:4:31
|
LL | let _: *const usize = std::mem::transmute(6.0f32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::wrong-transmute` implied by `-D warnings`

error: transmute from a `f32` to a pointer
--> $DIR/transmute_32bit.rs:5:29
|
LL | let _: *mut usize = std::mem::transmute(6.0f32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|

error: transmute from a `char` to a pointer
--> $DIR/transmute_32bit.rs:6:31
|
LL | let _: *const usize = std::mem::transmute('x');
| ^^^^^^^^^^^^^^^^^^^^^^^^
|

error: transmute from a `char` to a pointer
--> $DIR/transmute_32bit.rs:7:29
|
LL | let _: *mut usize = std::mem::transmute('x');
| ^^^^^^^^^^^^^^^^^^^^^^^^
|

error: aborting due to 4 previous errors

3 changes: 1 addition & 2 deletions tests/ui/transmute_64bit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//ignore-x86
//no-ignore-x86_64
// ignore-32bit

#[warn(clippy::wrong_transmute)]
fn main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/transmute_64bit.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: transmute from a `f64` to a pointer
--> $DIR/transmute_64bit.rs:7:31
--> $DIR/transmute_64bit.rs:6:31
|
LL | let _: *const usize = std::mem::transmute(6.0f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::wrong-transmute` implied by `-D warnings`

error: transmute from a `f64` to a pointer
--> $DIR/transmute_64bit.rs:9:29
--> $DIR/transmute_64bit.rs:8:29
|
LL | let _: *mut usize = std::mem::transmute(6.0f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit bef518c

Please sign in to comment.