Skip to content

Commit 15fc622

Browse files
committed
fixup! float: Use a shared assert_biteq! macro for tests
1 parent 2e4824d commit 15fc622

File tree

1 file changed

+7
-1
lines changed
  • library/coretests/tests/floats

1 file changed

+7
-1
lines changed

library/coretests/tests/floats/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ macro_rules! assert_biteq {
2121
($left:expr, $right:expr, $($tt:tt)*) => {{
2222
let l = $left;
2323
let r = $right;
24-
let bits = (l.to_bits() - l.to_bits()).leading_zeros(); // hack to get the width from a value
24+
25+
// Hack to coerce left and right to the same type
26+
let mut _eq_ty = l;
27+
_eq_ty = r;
28+
29+
// Hack to get the width from a value
30+
let bits = (l.to_bits() - l.to_bits()).leading_zeros();
2531
assert!(
2632
l.to_bits() == r.to_bits(),
2733
"{}\nl: {l:?} ({lb:#0width$x})\nr: {r:?} ({rb:#0width$x})",

0 commit comments

Comments
 (0)