File tree 2 files changed +40
-1
lines changed
2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 1
1
//ignore-x86_64
2
2
3
- #[ warn( wrong_transmute) ]
3
+ #[ warn( clippy :: wrong_transmute) ]
4
4
fn main ( ) {
5
5
unsafe {
6
6
let _: * const usize = std:: mem:: transmute ( 6.0f32 ) ;
Original file line number Diff line number Diff line change
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`.
You can’t perform that action at this time.
0 commit comments