diff --git a/consensus/state_processing/clippy.toml b/consensus/state_processing/clippy.toml new file mode 100644 index 000000000..e23d2ed05 --- /dev/null +++ b/consensus/state_processing/clippy.toml @@ -0,0 +1,5 @@ +# Disallow sum and product methods which are prone to overflow. +disallowed-methods = [ + "core::iter::traits::iterator::Iterator::sum", + "core::iter::traits::iterator::Iterator::product", +] diff --git a/consensus/state_processing/src/lib.rs b/consensus/state_processing/src/lib.rs index 4a04c0244..3ae90f885 100644 --- a/consensus/state_processing/src/lib.rs +++ b/consensus/state_processing/src/lib.rs @@ -1,4 +1,5 @@ #![deny(clippy::integer_arithmetic)] +#![deny(clippy::disallowed_method)] #[macro_use] mod macros; diff --git a/consensus/types/clippy.toml b/consensus/types/clippy.toml new file mode 100644 index 000000000..e23d2ed05 --- /dev/null +++ b/consensus/types/clippy.toml @@ -0,0 +1,5 @@ +# Disallow sum and product methods which are prone to overflow. +disallowed-methods = [ + "core::iter::traits::iterator::Iterator::sum", + "core::iter::traits::iterator::Iterator::product", +] diff --git a/consensus/types/src/beacon_state/tree_hash_cache.rs b/consensus/types/src/beacon_state/tree_hash_cache.rs index ddd85bb93..ee8cfb2dd 100644 --- a/consensus/types/src/beacon_state/tree_hash_cache.rs +++ b/consensus/types/src/beacon_state/tree_hash_cache.rs @@ -1,4 +1,5 @@ #![allow(clippy::integer_arithmetic)] +#![allow(clippy::disallowed_method)] use super::Error; use crate::{BeaconState, EthSpec, Hash256, Slot, Unsigned, Validator}; diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index be86daad5..5016b6f13 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -4,6 +4,7 @@ #![recursion_limit = "128"] // Clippy lint set up #![deny(clippy::integer_arithmetic)] +#![deny(clippy::disallowed_method)] #[macro_use] extern crate lazy_static;