@@ -107,135 +107,135 @@ LL | let _: char = unsafe { std::mem::transmute(0_i32) };
107107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_i32 as u32).unwrap()`
108108
109109error: transmute from a `u8` to a `bool`
110- --> $DIR/transmute.rs:80 :28
110+ --> $DIR/transmute.rs:84 :28
111111 |
112112LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
113113 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0`
114114 |
115115 = note: `-D clippy::transmute-int-to-bool` implied by `-D warnings`
116116
117117error: transmute from a `u32` to a `f32`
118- --> $DIR/transmute.rs:86 :31
118+ --> $DIR/transmute.rs:90 :31
119119 |
120120LL | let _: f32 = unsafe { std::mem::transmute(0_u32) };
121121 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_u32)`
122122 |
123123 = note: `-D clippy::transmute-int-to-float` implied by `-D warnings`
124124
125125error: transmute from a `i32` to a `f32`
126- --> $DIR/transmute.rs:87 :31
126+ --> $DIR/transmute.rs:91 :31
127127 |
128128LL | let _: f32 = unsafe { std::mem::transmute(0_i32) };
129129 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_i32 as u32)`
130130
131131error: transmute from a `u64` to a `f64`
132- --> $DIR/transmute.rs:88 :31
132+ --> $DIR/transmute.rs:92 :31
133133 |
134134LL | let _: f64 = unsafe { std::mem::transmute(0_u64) };
135135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_u64)`
136136
137137error: transmute from a `i64` to a `f64`
138- --> $DIR/transmute.rs:89 :31
138+ --> $DIR/transmute.rs:93 :31
139139 |
140140LL | let _: f64 = unsafe { std::mem::transmute(0_i64) };
141141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_i64 as u64)`
142142
143143error: transmute from a `u8` to a `[u8; 1]`
144- --> $DIR/transmute.rs:109 :30
144+ --> $DIR/transmute.rs:113 :30
145145 |
146146LL | let _: [u8; 1] = std::mem::transmute(0u8);
147147 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
148148 |
149149 = note: `-D clippy::transmute-num-to-bytes` implied by `-D warnings`
150150
151151error: transmute from a `u32` to a `[u8; 4]`
152- --> $DIR/transmute.rs:110 :30
152+ --> $DIR/transmute.rs:114 :30
153153 |
154154LL | let _: [u8; 4] = std::mem::transmute(0u32);
155155 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
156156
157157error: transmute from a `u128` to a `[u8; 16]`
158- --> $DIR/transmute.rs:111 :31
158+ --> $DIR/transmute.rs:115 :31
159159 |
160160LL | let _: [u8; 16] = std::mem::transmute(0u128);
161161 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
162162
163163error: transmute from a `i8` to a `[u8; 1]`
164- --> $DIR/transmute.rs:112 :30
164+ --> $DIR/transmute.rs:116 :30
165165 |
166166LL | let _: [u8; 1] = std::mem::transmute(0i8);
167167 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
168168
169169error: transmute from a `i32` to a `[u8; 4]`
170- --> $DIR/transmute.rs:113 :30
170+ --> $DIR/transmute.rs:117 :30
171171 |
172172LL | let _: [u8; 4] = std::mem::transmute(0i32);
173173 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
174174
175175error: transmute from a `i128` to a `[u8; 16]`
176- --> $DIR/transmute.rs:114 :31
176+ --> $DIR/transmute.rs:118 :31
177177 |
178178LL | let _: [u8; 16] = std::mem::transmute(0i128);
179179 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
180180
181181error: transmute from a `f32` to a `[u8; 4]`
182- --> $DIR/transmute.rs:115 :30
182+ --> $DIR/transmute.rs:119 :30
183183 |
184184LL | let _: [u8; 4] = std::mem::transmute(0.0f32);
185185 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()`
186186
187187error: transmute from a `f64` to a `[u8; 8]`
188- --> $DIR/transmute.rs:116 :30
188+ --> $DIR/transmute.rs:120 :30
189189 |
190190LL | let _: [u8; 8] = std::mem::transmute(0.0f64);
191191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()`
192192
193193error: transmute from a `u8` to a `[u8; 1]`
194- --> $DIR/transmute.rs:121 :30
194+ --> $DIR/transmute.rs:125 :30
195195 |
196196LL | let _: [u8; 1] = std::mem::transmute(0u8);
197197 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()`
198198
199199error: transmute from a `u32` to a `[u8; 4]`
200- --> $DIR/transmute.rs:122 :30
200+ --> $DIR/transmute.rs:126 :30
201201 |
202202LL | let _: [u8; 4] = std::mem::transmute(0u32);
203203 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()`
204204
205205error: transmute from a `u128` to a `[u8; 16]`
206- --> $DIR/transmute.rs:123 :31
206+ --> $DIR/transmute.rs:127 :31
207207 |
208208LL | let _: [u8; 16] = std::mem::transmute(0u128);
209209 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()`
210210
211211error: transmute from a `i8` to a `[u8; 1]`
212- --> $DIR/transmute.rs:124 :30
212+ --> $DIR/transmute.rs:128 :30
213213 |
214214LL | let _: [u8; 1] = std::mem::transmute(0i8);
215215 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()`
216216
217217error: transmute from a `i32` to a `[u8; 4]`
218- --> $DIR/transmute.rs:125 :30
218+ --> $DIR/transmute.rs:129 :30
219219 |
220220LL | let _: [u8; 4] = std::mem::transmute(0i32);
221221 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()`
222222
223223error: transmute from a `i128` to a `[u8; 16]`
224- --> $DIR/transmute.rs:126 :31
224+ --> $DIR/transmute.rs:130 :31
225225 |
226226LL | let _: [u8; 16] = std::mem::transmute(0i128);
227227 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()`
228228
229229error: transmute from a `&[u8]` to a `&str`
230- --> $DIR/transmute.rs:134 :28
230+ --> $DIR/transmute.rs:138 :28
231231 |
232232LL | let _: &str = unsafe { std::mem::transmute(b) };
233233 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(b).unwrap()`
234234 |
235235 = note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings`
236236
237237error: transmute from a `&mut [u8]` to a `&mut str`
238- --> $DIR/transmute.rs:135 :32
238+ --> $DIR/transmute.rs:139 :32
239239 |
240240LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
241241 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
0 commit comments