1
1
error: transmute from a reference to a pointer
2
- --> $DIR/transmute.rs:24 :23
2
+ --> $DIR/transmute.rs:29 :23
3
3
|
4
4
LL | let _: *const T = core::intrinsics::transmute(t);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T`
@@ -8,61 +8,61 @@ LL | let _: *const T = core::intrinsics::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
- --> $DIR/transmute.rs:28 :21
11
+ --> $DIR/transmute.rs:33 :21
12
12
|
13
13
LL | let _: *mut T = core::intrinsics::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
- --> $DIR/transmute.rs:31 :23
17
+ --> $DIR/transmute.rs:36 :23
18
18
|
19
19
LL | let _: *const U = core::intrinsics::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
- --> $DIR/transmute.rs:38 :27
23
+ --> $DIR/transmute.rs:43 :27
24
24
|
25
25
LL | let _: Vec<i32> = core::intrinsics::transmute(my_vec());
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27
27
28
28
error: transmute from a type (`std::vec::Vec<i32>`) to itself
29
- --> $DIR/transmute.rs:41 :27
29
+ --> $DIR/transmute.rs:46 :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
- --> $DIR/transmute.rs:44 :27
35
+ --> $DIR/transmute.rs:49 :27
36
36
|
37
37
LL | let _: Vec<i32> = std::intrinsics::transmute(my_vec());
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
39
40
40
error: transmute from a type (`std::vec::Vec<i32>`) to itself
41
- --> $DIR/transmute.rs:47 :27
41
+ --> $DIR/transmute.rs:52 :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
- --> $DIR/transmute.rs:50 :27
47
+ --> $DIR/transmute.rs:55 :27
48
48
|
49
49
LL | let _: Vec<i32> = my_transmute(my_vec());
50
50
| ^^^^^^^^^^^^^^^^^^^^^^
51
51
52
52
error: transmute from an integer to a pointer
53
- --> $DIR/transmute.rs:53 :31
53
+ --> $DIR/transmute.rs:58 :31
54
54
|
55
55
LL | let _: *const usize = std::mem::transmute(5_isize);
56
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `5_isize as *const usize`
57
57
58
58
error: transmute from an integer to a pointer
59
- --> $DIR/transmute.rs:58 :31
59
+ --> $DIR/transmute.rs:63 :31
60
60
|
61
61
LL | let _: *const usize = std::mem::transmute(1 + 1usize);
62
62
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(1 + 1usize) as *const usize`
63
63
64
64
error: transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
65
- --> $DIR/transmute.rs:90 :24
65
+ --> $DIR/transmute.rs:95 :24
66
66
|
67
67
LL | let _: Usize = core::intrinsics::transmute(int_const_ptr);
68
68
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -71,25 +71,25 @@ LL | let _: Usize = core::intrinsics::transmute(int_const_ptr);
71
71
= help: to override `-D warnings` add `#[allow(clippy::crosspointer_transmute)]`
72
72
73
73
error: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
74
- --> $DIR/transmute.rs:94 :24
74
+ --> $DIR/transmute.rs:99 :24
75
75
|
76
76
LL | let _: Usize = core::intrinsics::transmute(int_mut_ptr);
77
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
78
79
79
error: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
80
- --> $DIR/transmute.rs:97 :31
80
+ --> $DIR/transmute.rs:102 :31
81
81
|
82
82
LL | let _: *const Usize = core::intrinsics::transmute(my_int());
83
83
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84
84
85
85
error: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
86
- --> $DIR/transmute.rs:100 :29
86
+ --> $DIR/transmute.rs:105 :29
87
87
|
88
88
LL | let _: *mut Usize = core::intrinsics::transmute(my_int());
89
89
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90
90
91
91
error: transmute from a `u8` to a `bool`
92
- --> $DIR/transmute.rs:107 :28
92
+ --> $DIR/transmute.rs:112 :28
93
93
|
94
94
LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
95
95
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0`
@@ -98,7 +98,7 @@ LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
98
98
= help: to override `-D warnings` add `#[allow(clippy::transmute_int_to_bool)]`
99
99
100
100
error: transmute from a `u32` to a `f32`
101
- --> $DIR/transmute.rs:115 :31
101
+ --> $DIR/transmute.rs:120 :31
102
102
|
103
103
LL | let _: f32 = unsafe { std::mem::transmute(0_u32) };
104
104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_u32)`
@@ -107,25 +107,25 @@ LL | let _: f32 = unsafe { std::mem::transmute(0_u32) };
107
107
= help: to override `-D warnings` add `#[allow(clippy::transmute_int_to_float)]`
108
108
109
109
error: transmute from a `i32` to a `f32`
110
- --> $DIR/transmute.rs:118 :31
110
+ --> $DIR/transmute.rs:123 :31
111
111
|
112
112
LL | let _: f32 = unsafe { std::mem::transmute(0_i32) };
113
113
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_i32 as u32)`
114
114
115
115
error: transmute from a `u64` to a `f64`
116
- --> $DIR/transmute.rs:120 :31
116
+ --> $DIR/transmute.rs:125 :31
117
117
|
118
118
LL | let _: f64 = unsafe { std::mem::transmute(0_u64) };
119
119
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_u64)`
120
120
121
121
error: transmute from a `i64` to a `f64`
122
- --> $DIR/transmute.rs:122 :31
122
+ --> $DIR/transmute.rs:127 :31
123
123
|
124
124
LL | let _: f64 = unsafe { std::mem::transmute(0_i64) };
125
125
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_i64 as u64)`
126
126
127
127
error: transmute from a `u8` to a `[u8; 1]`
128
- --> $DIR/transmute.rs:143 :30
128
+ --> $DIR/transmute.rs:148 :30
129
129
|
130
130
LL | let _: [u8; 1] = std::mem::transmute(0u8);
131
131
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
@@ -134,85 +134,85 @@ LL | let _: [u8; 1] = std::mem::transmute(0u8);
134
134
= help: to override `-D warnings` add `#[allow(clippy::transmute_num_to_bytes)]`
135
135
136
136
error: transmute from a `u32` to a `[u8; 4]`
137
- --> $DIR/transmute.rs:146 :30
137
+ --> $DIR/transmute.rs:151 :30
138
138
|
139
139
LL | let _: [u8; 4] = std::mem::transmute(0u32);
140
140
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
141
141
142
142
error: transmute from a `u128` to a `[u8; 16]`
143
- --> $DIR/transmute.rs:148 :31
143
+ --> $DIR/transmute.rs:153 :31
144
144
|
145
145
LL | let _: [u8; 16] = std::mem::transmute(0u128);
146
146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
147
147
148
148
error: transmute from a `i8` to a `[u8; 1]`
149
- --> $DIR/transmute.rs:150 :30
149
+ --> $DIR/transmute.rs:155 :30
150
150
|
151
151
LL | let _: [u8; 1] = std::mem::transmute(0i8);
152
152
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
153
153
154
154
error: transmute from a `i32` to a `[u8; 4]`
155
- --> $DIR/transmute.rs:152 :30
155
+ --> $DIR/transmute.rs:157 :30
156
156
|
157
157
LL | let _: [u8; 4] = std::mem::transmute(0i32);
158
158
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
159
159
160
160
error: transmute from a `i128` to a `[u8; 16]`
161
- --> $DIR/transmute.rs:154 :31
161
+ --> $DIR/transmute.rs:159 :31
162
162
|
163
163
LL | let _: [u8; 16] = std::mem::transmute(0i128);
164
164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
165
165
166
166
error: transmute from a `f32` to a `[u8; 4]`
167
- --> $DIR/transmute.rs:156 :30
167
+ --> $DIR/transmute.rs:161 :30
168
168
|
169
169
LL | let _: [u8; 4] = std::mem::transmute(0.0f32);
170
170
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()`
171
171
172
172
error: transmute from a `f64` to a `[u8; 8]`
173
- --> $DIR/transmute.rs:158 :30
173
+ --> $DIR/transmute.rs:163 :30
174
174
|
175
175
LL | let _: [u8; 8] = std::mem::transmute(0.0f64);
176
176
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()`
177
177
178
178
error: transmute from a `u8` to a `[u8; 1]`
179
- --> $DIR/transmute.rs:164 :30
179
+ --> $DIR/transmute.rs:169 :30
180
180
|
181
181
LL | let _: [u8; 1] = std::mem::transmute(0u8);
182
182
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
183
183
184
184
error: transmute from a `u32` to a `[u8; 4]`
185
- --> $DIR/transmute.rs:166 :30
185
+ --> $DIR/transmute.rs:171 :30
186
186
|
187
187
LL | let _: [u8; 4] = std::mem::transmute(0u32);
188
188
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
189
189
190
190
error: transmute from a `u128` to a `[u8; 16]`
191
- --> $DIR/transmute.rs:168 :31
191
+ --> $DIR/transmute.rs:173 :31
192
192
|
193
193
LL | let _: [u8; 16] = std::mem::transmute(0u128);
194
194
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
195
195
196
196
error: transmute from a `i8` to a `[u8; 1]`
197
- --> $DIR/transmute.rs:170 :30
197
+ --> $DIR/transmute.rs:175 :30
198
198
|
199
199
LL | let _: [u8; 1] = std::mem::transmute(0i8);
200
200
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
201
201
202
202
error: transmute from a `i32` to a `[u8; 4]`
203
- --> $DIR/transmute.rs:172 :30
203
+ --> $DIR/transmute.rs:177 :30
204
204
|
205
205
LL | let _: [u8; 4] = std::mem::transmute(0i32);
206
206
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
207
207
208
208
error: transmute from a `i128` to a `[u8; 16]`
209
- --> $DIR/transmute.rs:174 :31
209
+ --> $DIR/transmute.rs:179 :31
210
210
|
211
211
LL | let _: [u8; 16] = std::mem::transmute(0i128);
212
212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
213
213
214
214
error: transmute from a `&[u8]` to a `&str`
215
- --> $DIR/transmute.rs:185 :28
215
+ --> $DIR/transmute.rs:190 :28
216
216
|
217
217
LL | let _: &str = unsafe { std::mem::transmute(B) };
218
218
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(B).unwrap()`
@@ -221,13 +221,13 @@ LL | let _: &str = unsafe { std::mem::transmute(B) };
221
221
= help: to override `-D warnings` add `#[allow(clippy::transmute_bytes_to_str)]`
222
222
223
223
error: transmute from a `&mut [u8]` to a `&mut str`
224
- --> $DIR/transmute.rs:188 :32
224
+ --> $DIR/transmute.rs:193 :32
225
225
|
226
226
LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
227
227
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
228
228
229
229
error: transmute from a `&[u8]` to a `&str`
230
- --> $DIR/transmute.rs:190 :30
230
+ --> $DIR/transmute.rs:195 :30
231
231
|
232
232
LL | const _: &str = unsafe { std::mem::transmute(B) };
233
233
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_unchecked(B)`
0 commit comments