1
1
error: transmute from a reference to a pointer
2
- --> tests/ui/transmute.rs:33 :27
2
+ --> tests/ui/transmute.rs:34 :27
3
3
|
4
4
LL | let _: *const T = core::mem::transmute(t);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T`
@@ -8,61 +8,49 @@ LL | let _: *const T = core::mem::transmute(t);
8
8
= help: to override `-D warnings` add `#[allow(clippy::useless_transmute)]`
9
9
10
10
error: transmute from a reference to a pointer
11
- --> tests/ui/transmute.rs:36 :25
11
+ --> tests/ui/transmute.rs:37 :25
12
12
|
13
13
LL | let _: *mut T = core::mem::transmute(t);
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *mut T`
15
15
16
16
error: transmute from a reference to a pointer
17
- --> tests/ui/transmute.rs:39 :27
17
+ --> tests/ui/transmute.rs:40 :27
18
18
|
19
19
LL | let _: *const U = core::mem::transmute(t);
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *const U`
21
21
22
22
error: transmute from a type (`std::vec::Vec<i32>`) to itself
23
- --> tests/ui/transmute.rs:47 :27
23
+ --> tests/ui/transmute.rs:48 :27
24
24
|
25
25
LL | let _: Vec<i32> = core::mem::transmute(my_vec());
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27
27
28
28
error: transmute from a type (`std::vec::Vec<i32>`) to itself
29
- --> tests/ui/transmute.rs:50 :27
29
+ --> tests/ui/transmute.rs:51 :27
30
30
|
31
31
LL | let _: Vec<i32> = core::mem::transmute(my_vec());
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33
33
34
34
error: transmute from a type (`std::vec::Vec<i32>`) to itself
35
- --> tests/ui/transmute.rs:53 :27
35
+ --> tests/ui/transmute.rs:54 :27
36
36
|
37
37
LL | let _: Vec<i32> = std::mem::transmute(my_vec());
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
39
40
40
error: transmute from a type (`std::vec::Vec<i32>`) to itself
41
- --> tests/ui/transmute.rs:56 :27
41
+ --> tests/ui/transmute.rs:57 :27
42
42
|
43
43
LL | let _: Vec<i32> = std::mem::transmute(my_vec());
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45
45
46
46
error: transmute from a type (`std::vec::Vec<i32>`) to itself
47
- --> tests/ui/transmute.rs:59 :27
47
+ --> tests/ui/transmute.rs:60 :27
48
48
|
49
49
LL | let _: Vec<i32> = my_transmute(my_vec());
50
50
| ^^^^^^^^^^^^^^^^^^^^^^
51
51
52
- error: transmute from an integer to a pointer
53
- --> tests/ui/transmute.rs:62:31
54
- |
55
- LL | let _: *const usize = std::mem::transmute(5_isize);
56
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `5_isize as *const usize`
57
-
58
- error: transmute from an integer to a pointer
59
- --> tests/ui/transmute.rs:67:31
60
- |
61
- LL | let _: *const usize = std::mem::transmute(1 + 1usize);
62
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(1 + 1usize) as *const usize`
63
-
64
52
error: transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
65
- --> tests/ui/transmute.rs:99 :24
53
+ --> tests/ui/transmute.rs:98 :24
66
54
|
67
55
LL | let _: Usize = core::mem::transmute(int_const_ptr);
68
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -71,25 +59,25 @@ LL | let _: Usize = core::mem::transmute(int_const_ptr);
71
59
= help: to override `-D warnings` add `#[allow(clippy::crosspointer_transmute)]`
72
60
73
61
error: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
74
- --> tests/ui/transmute.rs:102 :24
62
+ --> tests/ui/transmute.rs:101 :24
75
63
|
76
64
LL | let _: Usize = core::mem::transmute(int_mut_ptr);
77
65
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
66
79
67
error: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
80
- --> tests/ui/transmute.rs:105 :31
68
+ --> tests/ui/transmute.rs:104 :31
81
69
|
82
70
LL | let _: *const Usize = core::mem::transmute(my_int());
83
71
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84
72
85
73
error: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
86
- --> tests/ui/transmute.rs:108 :29
74
+ --> tests/ui/transmute.rs:107 :29
87
75
|
88
76
LL | let _: *mut Usize = core::mem::transmute(my_int());
89
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90
78
91
79
error: transmute from a `u8` to a `bool`
92
- --> tests/ui/transmute.rs:115 :28
80
+ --> tests/ui/transmute.rs:114 :28
93
81
|
94
82
LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
95
83
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0`
@@ -98,7 +86,7 @@ LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
98
86
= help: to override `-D warnings` add `#[allow(clippy::transmute_int_to_bool)]`
99
87
100
88
error: transmute from a `&[u8]` to a `&str`
101
- --> tests/ui/transmute.rs:122 :28
89
+ --> tests/ui/transmute.rs:121 :28
102
90
|
103
91
LL | let _: &str = unsafe { std::mem::transmute(B) };
104
92
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(B).unwrap()`
@@ -107,16 +95,16 @@ LL | let _: &str = unsafe { std::mem::transmute(B) };
107
95
= help: to override `-D warnings` add `#[allow(clippy::transmute_bytes_to_str)]`
108
96
109
97
error: transmute from a `&mut [u8]` to a `&mut str`
110
- --> tests/ui/transmute.rs:125 :32
98
+ --> tests/ui/transmute.rs:124 :32
111
99
|
112
100
LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
113
101
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
114
102
115
103
error: transmute from a `&[u8]` to a `&str`
116
- --> tests/ui/transmute.rs:128 :30
104
+ --> tests/ui/transmute.rs:127 :30
117
105
|
118
106
LL | const _: &str = unsafe { std::mem::transmute(B) };
119
107
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_unchecked(B)`
120
108
121
- error: aborting due to 18 previous errors
109
+ error: aborting due to 16 previous errors
122
110
0 commit comments