@@ -140,19 +140,105 @@ error: transmute from a `i64` to a `f64`
140140LL | let _: f64 = unsafe { std::mem::transmute(0_i64) };
141141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_i64 as u64)`
142142
143+ error: transmute from a `u8` to a `[u8; 1]`
144+ --> $DIR/transmute.rs:109:30
145+ |
146+ LL | let _: [u8; 1] = std::mem::transmute(0u8);
147+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
148+ |
149+ = note: `-D clippy::transmute-num-to-bytes` implied by `-D warnings`
150+
151+ error: transmute from a `u32` to a `[u8; 4]`
152+ --> $DIR/transmute.rs:110:30
153+ |
154+ LL | let _: [u8; 4] = std::mem::transmute(0u32);
155+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
156+
157+ error: transmute from a `u128` to a `[u8; 16]`
158+ --> $DIR/transmute.rs:111:31
159+ |
160+ LL | let _: [u8; 16] = std::mem::transmute(0u128);
161+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
162+
163+ error: transmute from a `i8` to a `[u8; 1]`
164+ --> $DIR/transmute.rs:112:30
165+ |
166+ LL | let _: [u8; 1] = std::mem::transmute(0i8);
167+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
168+
169+ error: transmute from a `i32` to a `[u8; 4]`
170+ --> $DIR/transmute.rs:113:30
171+ |
172+ LL | let _: [u8; 4] = std::mem::transmute(0i32);
173+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
174+
175+ error: transmute from a `i128` to a `[u8; 16]`
176+ --> $DIR/transmute.rs:114:31
177+ |
178+ LL | let _: [u8; 16] = std::mem::transmute(0i128);
179+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
180+
181+ error: transmute from a `f32` to a `[u8; 4]`
182+ --> $DIR/transmute.rs:115:30
183+ |
184+ LL | let _: [u8; 4] = std::mem::transmute(0.0f32);
185+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()`
186+
187+ error: transmute from a `f64` to a `[u8; 8]`
188+ --> $DIR/transmute.rs:116:30
189+ |
190+ LL | let _: [u8; 8] = std::mem::transmute(0.0f64);
191+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()`
192+
193+ error: transmute from a `u8` to a `[u8; 1]`
194+ --> $DIR/transmute.rs:121:30
195+ |
196+ LL | let _: [u8; 1] = std::mem::transmute(0u8);
197+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
198+
199+ error: transmute from a `u32` to a `[u8; 4]`
200+ --> $DIR/transmute.rs:122:30
201+ |
202+ LL | let _: [u8; 4] = std::mem::transmute(0u32);
203+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
204+
205+ error: transmute from a `u128` to a `[u8; 16]`
206+ --> $DIR/transmute.rs:123:31
207+ |
208+ LL | let _: [u8; 16] = std::mem::transmute(0u128);
209+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
210+
211+ error: transmute from a `i8` to a `[u8; 1]`
212+ --> $DIR/transmute.rs:124:30
213+ |
214+ LL | let _: [u8; 1] = std::mem::transmute(0i8);
215+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
216+
217+ error: transmute from a `i32` to a `[u8; 4]`
218+ --> $DIR/transmute.rs:125:30
219+ |
220+ LL | let _: [u8; 4] = std::mem::transmute(0i32);
221+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
222+
223+ error: transmute from a `i128` to a `[u8; 16]`
224+ --> $DIR/transmute.rs:126:31
225+ |
226+ LL | let _: [u8; 16] = std::mem::transmute(0i128);
227+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
228+
143229error: transmute from a `&[u8]` to a `&str`
144- --> $DIR/transmute.rs:107 :28
230+ --> $DIR/transmute.rs:134 :28
145231 |
146232LL | let _: &str = unsafe { std::mem::transmute(b) };
147233 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(b).unwrap()`
148234 |
149235 = note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
150236
151237error: transmute from a `&mut [u8]` to a `&mut str`
152- --> $DIR/transmute.rs:108 :32
238+ --> $DIR/transmute.rs:135 :32
153239 |
154240LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
155241 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
156242
157- error: aborting due to 24 previous errors
243+ error: aborting due to 38 previous errors
158244
0 commit comments