Removing superflous check for nightly

This commit is contained in:
Tomasz Drwięga
2016-03-11 11:16:49 +01:00
parent a8a21da9ba
commit d84e008e00
35 changed files with 56 additions and 131 deletions

View File

@@ -5,10 +5,6 @@ license = "GPL-3.0"
name = "ethcore"
version = "0.9.99"
authors = ["Ethcore <admin@ethcore.io>"]
build = "build.rs"
[build-dependencies]
rustc_version = "0.1"
[dependencies]
log = "0.3"
@@ -31,5 +27,5 @@ jit = ["evmjit"]
evm-debug = []
json-tests = []
test-heavy = []
dev = []
dev = ["clippy"]
default = []

View File

@@ -1,25 +0,0 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
extern crate rustc_version;
use rustc_version::{version_meta, Channel};
fn main() {
if let Channel::Nightly = version_meta().channel {
println!("cargo:rustc-cfg=nightly");
}
}

View File

@@ -24,7 +24,7 @@ pub type LogBloom = H2048;
/// Constant 2048-bit datum for 0. Often used as a default.
pub static ZERO_LOGBLOOM: LogBloom = H2048([0x00; 256]);
#[cfg_attr(all(nightly, feature="dev"), allow(enum_variant_names))]
#[cfg_attr(feature="dev", allow(enum_variant_names))]
/// Semantic boolean for when a seal/signature is included.
pub enum Seal {
/// The seal/signature is included.

View File

@@ -16,7 +16,7 @@
//! Blockchain block.
#![cfg_attr(all(nightly, feature="dev"), allow(ptr_arg))] // Because of &LastHashes -> &Vec<_>
#![cfg_attr(feature="dev", allow(ptr_arg))] // Because of &LastHashes -> &Vec<_>
use common::*;
use engine::*;

View File

@@ -121,7 +121,7 @@ struct QueueSignal {
}
impl QueueSignal {
#[cfg_attr(all(nightly, feature="dev"), allow(bool_comparison))]
#[cfg_attr(feature="dev", allow(bool_comparison))]
fn set(&self) {
if self.signalled.compare_and_swap(false, true, AtomicOrdering::Relaxed) == false {
self.message_channel.send(UserMessage(SyncMessage::BlockVerified)).expect("Error sending BlockVerified message");

View File

@@ -891,7 +891,7 @@ mod tests {
}
#[test]
#[cfg_attr(all(nightly, feature="dev"), allow(cyclomatic_complexity))]
#[cfg_attr(feature="dev", allow(cyclomatic_complexity))]
fn test_find_uncles() {
let mut canon_chain = ChainGenerator::default();
let mut finalizer = BlockFinalizer::default();
@@ -929,7 +929,7 @@ mod tests {
}
#[test]
#[cfg_attr(all(nightly, feature="dev"), allow(cyclomatic_complexity))]
#[cfg_attr(feature="dev", allow(cyclomatic_complexity))]
fn test_small_fork() {
let mut canon_chain = ChainGenerator::default();
let mut finalizer = BlockFinalizer::default();

View File

@@ -202,7 +202,7 @@ impl Engine for Ethash {
}
}
#[cfg_attr(all(nightly, feature="dev"), allow(wrong_self_convention))] // to_ethash should take self
#[cfg_attr(feature="dev", allow(wrong_self_convention))] // to_ethash should take self
impl Ethash {
fn calculate_difficuty(&self, header: &Header, parent: &Header) -> U256 {
const EXP_DIFF_PERIOD: u64 = 100000;

View File

@@ -243,7 +243,7 @@ struct CodeReader<'a> {
code: &'a Bytes
}
#[cfg_attr(all(nightly, feature="dev"), allow(len_without_is_empty))]
#[cfg_attr(feature="dev", allow(len_without_is_empty))]
impl<'a> CodeReader<'a> {
/// Get `no_of_bytes` from code and convert to U256. Move PC
fn read(&mut self, no_of_bytes: usize) -> U256 {
@@ -258,7 +258,7 @@ impl<'a> CodeReader<'a> {
}
}
#[cfg_attr(all(nightly, feature="dev"), allow(enum_variant_names))]
#[cfg_attr(feature="dev", allow(enum_variant_names))]
enum InstructionCost {
Gas(U256),
GasMem(U256, U256),
@@ -347,7 +347,7 @@ impl evm::Evm for Interpreter {
}
impl Interpreter {
#[cfg_attr(all(nightly, feature="dev"), allow(cyclomatic_complexity))]
#[cfg_attr(feature="dev", allow(cyclomatic_complexity))]
fn get_gas_cost_mem(&self,
ext: &evm::Ext,
instruction: Instruction,

View File

@@ -188,7 +188,7 @@ impl<'a> Ext for Externalities<'a> {
self.state.code(address).unwrap_or_else(|| vec![])
}
#[cfg_attr(all(nightly, feature="dev"), allow(match_ref_pats))]
#[cfg_attr(feature="dev", allow(match_ref_pats))]
fn ret(&mut self, gas: &U256, data: &[u8]) -> Result<U256, evm::Error> {
match &mut self.output {
&mut OutputPolicy::Return(BytesRef::Fixed(ref mut slice)) => unsafe {

View File

@@ -15,16 +15,16 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
#![warn(missing_docs)]
#![cfg_attr(all(nightly, feature="dev"), feature(plugin))]
#![cfg_attr(all(nightly, feature="dev"), plugin(clippy))]
#![cfg_attr(feature="dev", feature(plugin))]
#![cfg_attr(feature="dev", plugin(clippy))]
// Clippy config
// TODO [todr] not really sure
#![cfg_attr(all(nightly, feature="dev"), allow(needless_range_loop))]
#![cfg_attr(feature="dev", allow(needless_range_loop))]
// Shorter than if-else
#![cfg_attr(all(nightly, feature="dev"), allow(match_bool))]
#![cfg_attr(feature="dev", allow(match_bool))]
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
#![cfg_attr(all(nightly, feature="dev"), allow(clone_on_copy))]
#![cfg_attr(feature="dev", allow(clone_on_copy))]
//! Ethcore library
//!

View File

@@ -117,7 +117,7 @@ impl IoHandler<NetSyncMessage> for ClientIoHandler {
}
}
#[cfg_attr(all(nightly, feature="dev"), allow(single_match))]
#[cfg_attr(feature="dev", allow(single_match))]
fn message(&self, io: &IoContext<NetSyncMessage>, net_message: &NetSyncMessage) {
if let UserMessage(ref message) = *net_message {
match *message {

View File

@@ -99,7 +99,7 @@ pub struct Spec {
genesis_state: PodState,
}
#[cfg_attr(all(nightly, feature="dev"), allow(wrong_self_convention))] // because to_engine(self) should be to_engine(&self)
#[cfg_attr(feature="dev", allow(wrong_self_convention))] // because to_engine(self) should be to_engine(&self)
impl Spec {
/// Convert this object into a boxed Engine of the right underlying type.
// TODO avoid this hard-coded nastiness - use dynamic-linked plugin framework instead.

View File

@@ -224,7 +224,7 @@ impl State {
/// Commit accounts to SecTrieDBMut. This is similar to cpp-ethereum's dev::eth::commit.
/// `accounts` is mutable because we may need to commit the code or storage and record that.
#[cfg_attr(all(nightly, feature="dev"), allow(match_ref_pats))]
#[cfg_attr(feature="dev", allow(match_ref_pats))]
pub fn commit_into(db: &mut HashDB, root: &mut H256, accounts: &mut HashMap<Address, Option<Account>>) {
// first, commit the sub trees.
// TODO: is this necessary or can we dispense with the `ref mut a` for just `a`?

View File

@@ -80,7 +80,7 @@ impl Transaction {
}
impl FromJson for SignedTransaction {
#[cfg_attr(all(nightly, feature="dev"), allow(single_char_pattern))]
#[cfg_attr(feature="dev", allow(single_char_pattern))]
fn from_json(json: &Json) -> SignedTransaction {
let t = Transaction {
nonce: xjson!(&json["nonce"]),