Skip to content

Commit ebcf8b2

Browse files
committed
Auto merge of #4690 - lzutao:fix-test-on-non-amd64, r=phansch
generate stderr file on non x86-64 system changelog: none
2 parents ee6fc1b + 1f96524 commit ebcf8b2

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

tests/ui/transmute_32bit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//ignore-x86_64
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

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2+
--> $DIR/transmute_32bit.rs:6:31
3+
|
4+
LL | let _: *const usize = std::mem::transmute(6.0f32);
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: source type: `f32` (32 bits)
8+
= note: target type: `*const usize` (64 bits)
9+
10+
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
11+
--> $DIR/transmute_32bit.rs:8:29
12+
|
13+
LL | let _: *mut usize = std::mem::transmute(6.0f32);
14+
| ^^^^^^^^^^^^^^^^^^^
15+
|
16+
= note: source type: `f32` (32 bits)
17+
= note: target type: `*mut usize` (64 bits)
18+
19+
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
20+
--> $DIR/transmute_32bit.rs:10:31
21+
|
22+
LL | let _: *const usize = std::mem::transmute('x');
23+
| ^^^^^^^^^^^^^^^^^^^
24+
|
25+
= note: source type: `char` (32 bits)
26+
= note: target type: `*const usize` (64 bits)
27+
28+
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
29+
--> $DIR/transmute_32bit.rs:12:29
30+
|
31+
LL | let _: *mut usize = std::mem::transmute('x');
32+
| ^^^^^^^^^^^^^^^^^^^
33+
|
34+
= note: source type: `char` (32 bits)
35+
= note: target type: `*mut usize` (64 bits)
36+
37+
error: aborting due to 4 previous errors
38+
39+
For more information about this error, try `rustc --explain E0512`.

0 commit comments

Comments
 (0)