From 4751cb9ca1f01467e91d0fdfb9cba8a9d30d3bdb Mon Sep 17 00:00:00 2001 From: Brandon Falk Date: Fri, 29 Jun 2018 16:25:04 -0700 Subject: [PATCH] Fix PartialEq issue #511 --- coresimd/ppsv/api/partial_eq.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/coresimd/ppsv/api/partial_eq.rs b/coresimd/ppsv/api/partial_eq.rs index c99d8ece6b9d8..ab4997b72abfb 100644 --- a/coresimd/ppsv/api/partial_eq.rs +++ b/coresimd/ppsv/api/partial_eq.rs @@ -10,7 +10,7 @@ macro_rules! impl_partial_eq { } #[inline] fn ne(&self, other: &Self) -> bool { - $id::ne(*self, *other).all() + $id::ne(*self, *other).any() } } }; @@ -30,6 +30,18 @@ macro_rules! test_partial_eq { assert!(!(a == b)); assert!(a == a); assert!(!(a != a)); + + // Test further to make sure comparisons work with non-splatted + // values. + // This is to test the fix for #511 + + let a = $id::splat($false).replace(0, $true); + let b = $id::splat($true); + + assert!(a != b); + assert!(!(a == b)); + assert!(a == a); + assert!(!(a != a)); } }; }