File tree 4 files changed +36
-6
lines changed
4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 1
- //ignore-x86_64
1
+ // ignore-64bit
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: transmute from a `f32` to a pointer
2
+ --> $DIR/transmute_32bit.rs:4: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:5:29
11
+ |
12
+ LL | let _: *mut usize = std::mem::transmute(6.0f32);
13
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
+ |
15
+
16
+ error: transmute from a `char` to a pointer
17
+ --> $DIR/transmute_32bit.rs:6:31
18
+ |
19
+ LL | let _: *const usize = std::mem::transmute('x');
20
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
21
+ |
22
+
23
+ error: transmute from a `char` to a pointer
24
+ --> $DIR/transmute_32bit.rs:7:29
25
+ |
26
+ LL | let _: *mut usize = std::mem::transmute('x');
27
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
28
+ |
29
+
30
+ error: aborting due to 4 previous errors
31
+
Original file line number Diff line number Diff line change 1
- //ignore-x86
2
- //no-ignore-x86_64
1
+ // ignore-32bit
3
2
4
3
#[ warn( clippy:: wrong_transmute) ]
5
4
fn main ( ) {
Original file line number Diff line number Diff line change 1
1
error: transmute from a `f64` to a pointer
2
- --> $DIR/transmute_64bit.rs:7 :31
2
+ --> $DIR/transmute_64bit.rs:6 :31
3
3
|
4
4
LL | let _: *const usize = std::mem::transmute(6.0f64);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
7
= note: `-D clippy::wrong-transmute` implied by `-D warnings`
8
8
9
9
error: transmute from a `f64` to a pointer
10
- --> $DIR/transmute_64bit.rs:9 :29
10
+ --> $DIR/transmute_64bit.rs:8 :29
11
11
|
12
12
LL | let _: *mut usize = std::mem::transmute(6.0f64);
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments