Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(grumble): use cfg_attr to define rustc feature
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 committed Mar 14, 2019
1 parent ae10434 commit 4e07fea
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ethcore/src/engines/authority_round/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use types::header::{Header, ExtendedHeader};
use types::ancestry_action::AncestryAction;
use unexpected::{Mismatch, OutOfBounds};

#[cfg(not(feature = "time_checked_add"))]
#[cfg(not(time_checked_add))]
use time_utils::CheckedSystemTime;

mod finality;
Expand Down
5 changes: 4 additions & 1 deletion ethcore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.

#![warn(missing_docs, unused_extern_crates)]
#![cfg_attr(feature = "time_checked_add", feature(time_checked_add))]

//! Ethcore library
//!
Expand Down Expand Up @@ -99,7 +100,6 @@ extern crate rlp;
extern crate rustc_hex;
extern crate serde;
extern crate stats;
extern crate time_utils;
extern crate triehash_ethereum as triehash;
extern crate unexpected;
extern crate using_queue;
Expand Down Expand Up @@ -149,6 +149,9 @@ extern crate fetch;
#[cfg(all(test, feature = "price-info"))]
extern crate parity_runtime;

#[cfg(not(time_checked_add))]
extern crate time_utils;

pub mod block;
pub mod builtin;
pub mod client;
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/verification/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use types::{BlockNumber, header::Header};
use types::transaction::SignedTransaction;
use verification::queue::kind::blocks::Unverified;

#[cfg(not(feature = "time_checked_add"))]
#[cfg(not(time_checked_add))]
use time_utils::CheckedSystemTime;

/// Preprocessed block data gathered in `verify_block_unordered` call
Expand Down
6 changes: 5 additions & 1 deletion whisper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
//! Whisper P2P messaging system as a DevP2P subprotocol, with RPC and Rust
//! interface.
#![cfg_attr(feature = "time_checked_add", feature(time_checked_add))]

extern crate byteorder;
extern crate parity_crypto as crypto;
extern crate ethcore_network as network;
Expand All @@ -32,7 +34,6 @@ extern crate serde;
extern crate slab;
extern crate smallvec;
extern crate tiny_keccak;
extern crate time_utils;

extern crate jsonrpc_core;
extern crate jsonrpc_derive;
Expand All @@ -47,6 +48,9 @@ extern crate log;
#[macro_use]
extern crate serde_derive;

#[cfg(not(time_checked_add))]
extern crate time_utils;

#[cfg(test)]
extern crate serde_json;

Expand Down
2 changes: 1 addition & 1 deletion whisper/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use rlp::{self, DecoderError, RlpStream, Rlp};
use smallvec::SmallVec;
use tiny_keccak::{keccak256, Keccak};

#[cfg(not(feature = "time_checked_add"))]
#[cfg(not(time_checked_add))]
use time_utils::CheckedSystemTime;

/// Work-factor proved. Takes 3 parameters: size of message, time to live,
Expand Down

0 comments on commit 4e07fea

Please sign in to comment.