From f16de5501a7b7ec0ff6e5d426fb336be4f4b7066 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Thu, 29 Sep 2016 16:20:56 +0200 Subject: [PATCH] fix broken beta compilation --- ethkey/src/signature.rs | 4 +++- rpc/src/v1/types/hash.rs | 3 ++- rpc/src/v1/types/uint.rs | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ethkey/src/signature.rs b/ethkey/src/signature.rs index 407903a84..657a76675 100644 --- a/ethkey/src/signature.rs +++ b/ethkey/src/signature.rs @@ -23,7 +23,6 @@ use rustc_serialize::hex::{ToHex, FromHex}; use {Secret, Public, SECP256K1, Error, Message, public_to_address, Address}; #[repr(C)] -#[derive(Eq)] pub struct Signature([u8; 65]); impl Signature { @@ -51,6 +50,9 @@ impl ::std::cmp::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. impl fmt::Debug for Signature { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs index 22d6a0588..fc6c8eb1d 100644 --- a/rpc/src/v1/types/hash.rs +++ b/rpc/src/v1/types/hash.rs @@ -25,9 +25,10 @@ use util::{H64 as Eth64, H256 as EthH256, H520 as EthH520, H2048 as Eth2048, Add macro_rules! impl_hash { ($name: ident, $other: ident, $size: expr) => { /// Hash serialization - #[derive(Eq)] pub struct $name([u8; $size]); + impl Eq for $name { } + impl Default for $name { fn default() -> Self { $name([0; $size]) diff --git a/rpc/src/v1/types/uint.rs b/rpc/src/v1/types/uint.rs index b1cb0521f..651f7cb90 100644 --- a/rpc/src/v1/types/uint.rs +++ b/rpc/src/v1/types/uint.rs @@ -23,9 +23,11 @@ use util::{U256 as EthU256, Uint}; macro_rules! impl_uint { ($name: ident, $other: ident, $size: expr) => { /// Uint serialization. - #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] + #[derive(Debug, Default, Clone, Copy, PartialEq, Hash)] pub struct $name($other); + impl Eq for $name { } + impl From for $name where $other: From { fn from(o: T) -> Self { $name($other::from(o))