Skip to content

Commit

Permalink
Fix PartialEq issue rust-lang#511
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Falk authored and gnzlbg committed Jul 2, 2018
1 parent 9be3699 commit 4751cb9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion coresimd/ppsv/api/partial_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
};
Expand All @@ -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));
}
};
}

0 comments on commit 4751cb9

Please sign in to comment.