Skip to content

Commit 4751cb9

Browse files
Brandon Falkgnzlbg
Brandon Falk
authored andcommitted
Fix PartialEq issue #511
1 parent 9be3699 commit 4751cb9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

coresimd/ppsv/api/partial_eq.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ macro_rules! impl_partial_eq {
1010
}
1111
#[inline]
1212
fn ne(&self, other: &Self) -> bool {
13-
$id::ne(*self, *other).all()
13+
$id::ne(*self, *other).any()
1414
}
1515
}
1616
};
@@ -30,6 +30,18 @@ macro_rules! test_partial_eq {
3030
assert!(!(a == b));
3131
assert!(a == a);
3232
assert!(!(a != a));
33+
34+
// Test further to make sure comparisons work with non-splatted
35+
// values.
36+
// This is to test the fix for #511
37+
38+
let a = $id::splat($false).replace(0, $true);
39+
let b = $id::splat($true);
40+
41+
assert!(a != b);
42+
assert!(!(a == b));
43+
assert!(a == a);
44+
assert!(!(a != a));
3345
}
3446
};
3547
}

0 commit comments

Comments
 (0)