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.
assert_biteq!
1 parent 2e4824d commit 15fc622Copy full SHA for 15fc622
library/coretests/tests/floats/mod.rs
@@ -21,7 +21,13 @@ macro_rules! assert_biteq {
21
($left:expr, $right:expr, $($tt:tt)*) => {{
22
let l = $left;
23
let r = $right;
24
- let bits = (l.to_bits() - l.to_bits()).leading_zeros(); // hack to get the width from a value
+
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();
31
assert!(
32
l.to_bits() == r.to_bits(),
33
"{}\nl: {l:?} ({lb:#0width$x})\nr: {r:?} ({rb:#0width$x})",
0 commit comments