@@ -107,135 +107,135 @@ LL | let _: char = unsafe { std::mem::transmute(0_i32) };
107
107
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_i32 as u32).unwrap()`
108
108
109
109
error: transmute from a `u8` to a `bool`
110
- --> $DIR/transmute.rs:80 :28
110
+ --> $DIR/transmute.rs:84 :28
111
111
|
112
112
LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
113
113
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0`
114
114
|
115
115
= note: `-D clippy::transmute-int-to-bool` implied by `-D warnings`
116
116
117
117
error: transmute from a `u32` to a `f32`
118
- --> $DIR/transmute.rs:86 :31
118
+ --> $DIR/transmute.rs:90 :31
119
119
|
120
120
LL | let _: f32 = unsafe { std::mem::transmute(0_u32) };
121
121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_u32)`
122
122
|
123
123
= note: `-D clippy::transmute-int-to-float` implied by `-D warnings`
124
124
125
125
error: transmute from a `i32` to a `f32`
126
- --> $DIR/transmute.rs:87 :31
126
+ --> $DIR/transmute.rs:91 :31
127
127
|
128
128
LL | let _: f32 = unsafe { std::mem::transmute(0_i32) };
129
129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_i32 as u32)`
130
130
131
131
error: transmute from a `u64` to a `f64`
132
- --> $DIR/transmute.rs:88 :31
132
+ --> $DIR/transmute.rs:92 :31
133
133
|
134
134
LL | let _: f64 = unsafe { std::mem::transmute(0_u64) };
135
135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_u64)`
136
136
137
137
error: transmute from a `i64` to a `f64`
138
- --> $DIR/transmute.rs:89 :31
138
+ --> $DIR/transmute.rs:93 :31
139
139
|
140
140
LL | let _: f64 = unsafe { std::mem::transmute(0_i64) };
141
141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_i64 as u64)`
142
142
143
143
error: transmute from a `u8` to a `[u8; 1]`
144
- --> $DIR/transmute.rs:109 :30
144
+ --> $DIR/transmute.rs:113 :30
145
145
|
146
146
LL | let _: [u8; 1] = std::mem::transmute(0u8);
147
147
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
148
148
|
149
149
= note: `-D clippy::transmute-num-to-bytes` implied by `-D warnings`
150
150
151
151
error: transmute from a `u32` to a `[u8; 4]`
152
- --> $DIR/transmute.rs:110 :30
152
+ --> $DIR/transmute.rs:114 :30
153
153
|
154
154
LL | let _: [u8; 4] = std::mem::transmute(0u32);
155
155
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
156
156
157
157
error: transmute from a `u128` to a `[u8; 16]`
158
- --> $DIR/transmute.rs:111 :31
158
+ --> $DIR/transmute.rs:115 :31
159
159
|
160
160
LL | let _: [u8; 16] = std::mem::transmute(0u128);
161
161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
162
162
163
163
error: transmute from a `i8` to a `[u8; 1]`
164
- --> $DIR/transmute.rs:112 :30
164
+ --> $DIR/transmute.rs:116 :30
165
165
|
166
166
LL | let _: [u8; 1] = std::mem::transmute(0i8);
167
167
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
168
168
169
169
error: transmute from a `i32` to a `[u8; 4]`
170
- --> $DIR/transmute.rs:113 :30
170
+ --> $DIR/transmute.rs:117 :30
171
171
|
172
172
LL | let _: [u8; 4] = std::mem::transmute(0i32);
173
173
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
174
174
175
175
error: transmute from a `i128` to a `[u8; 16]`
176
- --> $DIR/transmute.rs:114 :31
176
+ --> $DIR/transmute.rs:118 :31
177
177
|
178
178
LL | let _: [u8; 16] = std::mem::transmute(0i128);
179
179
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
180
180
181
181
error: transmute from a `f32` to a `[u8; 4]`
182
- --> $DIR/transmute.rs:115 :30
182
+ --> $DIR/transmute.rs:119 :30
183
183
|
184
184
LL | let _: [u8; 4] = std::mem::transmute(0.0f32);
185
185
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()`
186
186
187
187
error: transmute from a `f64` to a `[u8; 8]`
188
- --> $DIR/transmute.rs:116 :30
188
+ --> $DIR/transmute.rs:120 :30
189
189
|
190
190
LL | let _: [u8; 8] = std::mem::transmute(0.0f64);
191
191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()`
192
192
193
193
error: transmute from a `u8` to a `[u8; 1]`
194
- --> $DIR/transmute.rs:121 :30
194
+ --> $DIR/transmute.rs:125 :30
195
195
|
196
196
LL | let _: [u8; 1] = std::mem::transmute(0u8);
197
197
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
198
198
199
199
error: transmute from a `u32` to a `[u8; 4]`
200
- --> $DIR/transmute.rs:122 :30
200
+ --> $DIR/transmute.rs:126 :30
201
201
|
202
202
LL | let _: [u8; 4] = std::mem::transmute(0u32);
203
203
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
204
204
205
205
error: transmute from a `u128` to a `[u8; 16]`
206
- --> $DIR/transmute.rs:123 :31
206
+ --> $DIR/transmute.rs:127 :31
207
207
|
208
208
LL | let _: [u8; 16] = std::mem::transmute(0u128);
209
209
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
210
210
211
211
error: transmute from a `i8` to a `[u8; 1]`
212
- --> $DIR/transmute.rs:124 :30
212
+ --> $DIR/transmute.rs:128 :30
213
213
|
214
214
LL | let _: [u8; 1] = std::mem::transmute(0i8);
215
215
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
216
216
217
217
error: transmute from a `i32` to a `[u8; 4]`
218
- --> $DIR/transmute.rs:125 :30
218
+ --> $DIR/transmute.rs:129 :30
219
219
|
220
220
LL | let _: [u8; 4] = std::mem::transmute(0i32);
221
221
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
222
222
223
223
error: transmute from a `i128` to a `[u8; 16]`
224
- --> $DIR/transmute.rs:126 :31
224
+ --> $DIR/transmute.rs:130 :31
225
225
|
226
226
LL | let _: [u8; 16] = std::mem::transmute(0i128);
227
227
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
228
228
229
229
error: transmute from a `&[u8]` to a `&str`
230
- --> $DIR/transmute.rs:134 :28
230
+ --> $DIR/transmute.rs:138 :28
231
231
|
232
232
LL | let _: &str = unsafe { std::mem::transmute(b) };
233
233
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(b).unwrap()`
234
234
|
235
235
= note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
236
236
237
237
error: transmute from a `&mut [u8]` to a `&mut str`
238
- --> $DIR/transmute.rs:135 :32
238
+ --> $DIR/transmute.rs:139 :32
239
239
|
240
240
LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
241
241
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
0 commit comments