Skip to content

Commit 135f80c

Browse files
committed
generate stderr file on 32bit pointer system
1 parent 1d0f625 commit 135f80c

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

tests/ui/transmute_32bit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//ignore-x86_64
1+
// ignore-64bit
22

3-
#[warn(wrong_transmute)]
3+
#[warn(clippy::wrong_transmute)]
44
fn main() {
55
unsafe {
66
let _: *const usize = std::mem::transmute(6.0f32);

tests/ui/transmute_32bit.stderr

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
error: transmute from a `f32` to a pointer
2+
--> $DIR/transmute_32bit.rs:6:31
3+
|
4+
LL | let _: *const usize = std::mem::transmute(6.0f32);
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `-D clippy::wrong-transmute` implied by `-D warnings`
8+
9+
error: transmute from a `f32` to a pointer
10+
--> $DIR/transmute_32bit.rs:8:29
11+
|
12+
LL | let _: *mut usize = std::mem::transmute(6.0f32);
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
15+
error: transmute from a `char` to a pointer
16+
--> $DIR/transmute_32bit.rs:10:31
17+
|
18+
LL | let _: *const usize = std::mem::transmute('x');
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^
20+
21+
error: transmute from a `char` to a pointer
22+
--> $DIR/transmute_32bit.rs:12:29
23+
|
24+
LL | let _: *mut usize = std::mem::transmute('x');
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^
26+
27+
error: aborting due to 4 previous errors
28+

tests/ui/transmute_64bit.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//ignore-x86
2-
//no-ignore-x86_64
1+
// ignore-32bit
32

43
#[warn(clippy::wrong_transmute)]
54
fn main() {

tests/ui/transmute_64bit.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: transmute from a `f64` to a pointer
2-
--> $DIR/transmute_64bit.rs:7:31
2+
--> $DIR/transmute_64bit.rs:6:31
33
|
44
LL | let _: *const usize = std::mem::transmute(6.0f64);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::wrong-transmute` implied by `-D warnings`
88

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

0 commit comments

Comments
 (0)