We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79febae commit 9e8aa21Copy full SHA for 9e8aa21
compiler/rustc_data_structures/src/stable_hasher.rs
@@ -229,14 +229,14 @@ impl<CTX> HashStable<CTX> for ::std::num::NonZeroUsize {
229
230
impl<CTX> HashStable<CTX> for f32 {
231
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
232
- let val: u32 = self.to_bits();
+ let val: u32 = unsafe { ::std::mem::transmute(*self) };
233
val.hash_stable(ctx, hasher);
234
}
235
236
237
impl<CTX> HashStable<CTX> for f64 {
238
239
- let val: u64 = self.to_bits();
+ let val: u64 = unsafe { ::std::mem::transmute(*self) };
240
241
242
0 commit comments