Skip to content

Commit 9e8aa21

Browse files
committed
revert changes to compiler/rustc_data_structures/src/stable_hasher.rs in 71dd0b9
1 parent 79febae commit 9e8aa21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_data_structures/src/stable_hasher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,14 @@ impl<CTX> HashStable<CTX> for ::std::num::NonZeroUsize {
229229

230230
impl<CTX> HashStable<CTX> for f32 {
231231
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
232-
let val: u32 = self.to_bits();
232+
let val: u32 = unsafe { ::std::mem::transmute(*self) };
233233
val.hash_stable(ctx, hasher);
234234
}
235235
}
236236

237237
impl<CTX> HashStable<CTX> for f64 {
238238
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
239-
let val: u64 = self.to_bits();
239+
let val: u64 = unsafe { ::std::mem::transmute(*self) };
240240
val.hash_stable(ctx, hasher);
241241
}
242242
}

0 commit comments

Comments
 (0)