PartialEq<Rational> for (u8,u8), and others
(From quaternic at internals.rust-lang.org)
Continuing the discussion from #53 (comment 1525581101):
Thanks for patching that quickly!
While looking at PartialEq: handle longer transitive chains by RalfJung · Pull Request #115386 · rust-lang/rust · GitHub today, I thought to check which impls rug has, and realized that the symmetric impls for Rational == (u8, u8)
and similar don't fulfill the transitivity required by PartialEq
(even without that PR). E.g. this assert fails:
let x = rug::Rational::from(3);
let a = (6,2);
let b = (9,3);
dbg!(a == x, x == b); // true, true
assert_eq!(&a, &b, "clearly false but required for transitivity");
However, it's not clear to me if PartialEq should have that requirement. Some earlier discussions around the topic:
Edited by Trevor Spiteri