Merge pull request #2405 from ethcore/fix-beta-eq

fix broken beta compilation
This commit is contained in:
Robert Habermeier 2016-09-29 18:58:46 +02:00 committed by GitHub
commit a37def823e
3 changed files with 8 additions and 3 deletions

View File

@ -25,7 +25,6 @@ use bigint::hash::{H520, H256, FixedHash};
use {Secret, Public, SECP256K1, Error, Message, public_to_address, Address}; use {Secret, Public, SECP256K1, Error, Message, public_to_address, Address};
#[repr(C)] #[repr(C)]
#[derive(Eq)]
pub struct Signature([u8; 65]); pub struct Signature([u8; 65]);
impl Signature { impl Signature {
@ -76,6 +75,9 @@ impl PartialEq for Signature {
} }
} }
// manual implementation required in Rust 1.13+, see `std::cmp::AssertParamIsEq`.
impl Eq for Signature { }
// also manual for the same reason, but the pretty printing might be useful. // also manual for the same reason, but the pretty printing might be useful.
impl fmt::Debug for Signature { impl fmt::Debug for Signature {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {

View File

@ -25,9 +25,10 @@ use util::{H64 as Eth64, H160 as Eth160, H256 as Eth256, H520 as Eth520, H512 as
macro_rules! impl_hash { macro_rules! impl_hash {
($name: ident, $other: ident, $size: expr) => { ($name: ident, $other: ident, $size: expr) => {
/// Hash serialization /// Hash serialization
#[derive(Eq)]
pub struct $name([u8; $size]); pub struct $name([u8; $size]);
impl Eq for $name { }
impl Default for $name { impl Default for $name {
fn default() -> Self { fn default() -> Self {
$name([0; $size]) $name([0; $size])

View File

@ -23,9 +23,11 @@ use util::{U256 as EthU256, Uint};
macro_rules! impl_uint { macro_rules! impl_uint {
($name: ident, $other: ident, $size: expr) => { ($name: ident, $other: ident, $size: expr) => {
/// Uint serialization. /// Uint serialization.
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] #[derive(Debug, Default, Clone, Copy, PartialEq, Hash)]
pub struct $name($other); pub struct $name($other);
impl Eq for $name { }
impl<T> From<T> for $name where $other: From<T> { impl<T> From<T> for $name where $other: From<T> {
fn from(o: T) -> Self { fn from(o: T) -> Self {
$name($other::from(o)) $name($other::from(o))