diff --git a/tower-batch/Cargo.toml b/tower-batch/Cargo.toml index 9a9fb9da..fb6c6474 100644 --- a/tower-batch/Cargo.toml +++ b/tower-batch/Cargo.toml @@ -3,7 +3,7 @@ name = "tower-batch" version = "0.2.19" authors = ["Zcash Foundation "] license = "MIT" -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.19" diff --git a/tower-batch/src/lib.rs b/tower-batch/src/lib.rs index edd8a431..6a6e1b88 100644 --- a/tower-batch/src/lib.rs +++ b/tower-batch/src/lib.rs @@ -89,6 +89,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] pub mod error; diff --git a/tower-fallback/Cargo.toml b/tower-fallback/Cargo.toml index 5fd67c47..3c991daa 100644 --- a/tower-fallback/Cargo.toml +++ b/tower-fallback/Cargo.toml @@ -3,7 +3,7 @@ name = "tower-fallback" version = "0.2.15" authors = ["Zcash Foundation "] license = "MIT" -edition = "2018" +edition = "2021" [dependencies] tower = "0.4" diff --git a/tower-fallback/src/lib.rs b/tower-fallback/src/lib.rs index cc73bac1..2cb4d20e 100644 --- a/tower-fallback/src/lib.rs +++ b/tower-fallback/src/lib.rs @@ -14,6 +14,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] pub mod future; diff --git a/zebra-chain/Cargo.toml b/zebra-chain/Cargo.toml index b72df6fa..9b6a08cd 100644 --- a/zebra-chain/Cargo.toml +++ b/zebra-chain/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-chain" version = "1.0.0-beta.3" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/zebra-chain/src/lib.rs b/zebra-chain/src/lib.rs index 3bbbb42d..79d6a005 100644 --- a/zebra-chain/src/lib.rs +++ b/zebra-chain/src/lib.rs @@ -10,6 +10,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] // Required by bitvec! macro #![recursion_limit = "256"] diff --git a/zebra-chain/src/primitives/redpallas/verification_key.rs b/zebra-chain/src/primitives/redpallas/verification_key.rs index d1ce2634..f8442712 100644 --- a/zebra-chain/src/primitives/redpallas/verification_key.rs +++ b/zebra-chain/src/primitives/redpallas/verification_key.rs @@ -1,4 +1,4 @@ -use std::{convert::TryFrom, marker::PhantomData}; +use std::marker::PhantomData; use group::{cofactor::CofactorGroup, GroupEncoding}; use halo2::{arithmetic::FieldExt, pasta::pallas}; @@ -95,7 +95,6 @@ impl TryFrom<[u8; 32]> for VerificationKey { type Error = Error; fn try_from(bytes: [u8; 32]) -> Result { - use std::convert::TryInto; VerificationKeyBytes::from(bytes).try_into() } } diff --git a/zebra-chain/src/value_balance.rs b/zebra-chain/src/value_balance.rs index a2716422..05d53a22 100644 --- a/zebra-chain/src/value_balance.rs +++ b/zebra-chain/src/value_balance.rs @@ -311,8 +311,6 @@ impl ValueBalance { /// The resulting [`ValueBalance`] will have half of the MAX_MONEY amount on each pool. #[cfg(any(test, feature = "proptest-impl"))] pub fn fake_populated_pool() -> ValueBalance { - use std::convert::TryFrom; - let mut fake_value_pool = ValueBalance::zero(); let fake_transparent_value_balance = diff --git a/zebra-client/Cargo.toml b/zebra-client/Cargo.toml index 4b140fd8..f942ba1c 100644 --- a/zebra-client/Cargo.toml +++ b/zebra-client/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-client" version = "1.0.0-beta.0" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/zebra-client/src/lib.rs b/zebra-client/src/lib.rs index 8a8bd09d..29892411 100644 --- a/zebra-client/src/lib.rs +++ b/zebra-client/src/lib.rs @@ -7,4 +7,5 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] diff --git a/zebra-consensus/Cargo.toml b/zebra-consensus/Cargo.toml index 7ef66447..4f431258 100644 --- a/zebra-consensus/Cargo.toml +++ b/zebra-consensus/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-consensus" version = "1.0.0-beta.3" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [features] default = [] diff --git a/zebra-consensus/src/lib.rs b/zebra-consensus/src/lib.rs index bab7a166..6d27f678 100644 --- a/zebra-consensus/src/lib.rs +++ b/zebra-consensus/src/lib.rs @@ -38,6 +38,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] mod block; @@ -54,9 +55,7 @@ pub mod chain; pub mod error; pub use block::VerifyBlockError; -pub use checkpoint::VerifyCheckpointError; -pub use checkpoint::MAX_CHECKPOINT_BYTE_COUNT; -pub use checkpoint::MAX_CHECKPOINT_HEIGHT_GAP; +pub use checkpoint::{VerifyCheckpointError, MAX_CHECKPOINT_BYTE_COUNT, MAX_CHECKPOINT_HEIGHT_GAP}; pub use config::Config; pub use error::BlockError; pub use primitives::groth16; diff --git a/zebra-network/Cargo.toml b/zebra-network/Cargo.toml index db1fab2f..3f70284e 100644 --- a/zebra-network/Cargo.toml +++ b/zebra-network/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-network" version = "1.0.0-beta.3" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/zebra-network/src/lib.rs b/zebra-network/src/lib.rs index 82c8ceba..d9867251 100644 --- a/zebra-network/src/lib.rs +++ b/zebra-network/src/lib.rs @@ -37,6 +37,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] #[macro_use] diff --git a/zebra-network/src/protocol/external/codec.rs b/zebra-network/src/protocol/external/codec.rs index f1c53829..36e0a971 100644 --- a/zebra-network/src/protocol/external/codec.rs +++ b/zebra-network/src/protocol/external/codec.rs @@ -184,7 +184,7 @@ impl Codec { /// for large data structures like lists, blocks, and transactions. /// See #1774. fn body_length(&self, msg: &Message) -> usize { - let mut writer = FakeWriter { 0: 0 }; + let mut writer = FakeWriter(0); self.write_body(msg, &mut writer) .expect("writer should never fail"); diff --git a/zebra-rpc/Cargo.toml b/zebra-rpc/Cargo.toml index 1f599051..e866af9a 100644 --- a/zebra-rpc/Cargo.toml +++ b/zebra-rpc/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-rpc" version = "1.0.0-beta.0" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/zebra-rpc/src/lib.rs b/zebra-rpc/src/lib.rs index a8e35df4..02f87917 100644 --- a/zebra-rpc/src/lib.rs +++ b/zebra-rpc/src/lib.rs @@ -7,4 +7,5 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] diff --git a/zebra-script/Cargo.toml b/zebra-script/Cargo.toml index 1dedcc30..cf83c01d 100644 --- a/zebra-script/Cargo.toml +++ b/zebra-script/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-script" version = "1.0.0-beta.3" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/zebra-script/src/lib.rs b/zebra-script/src/lib.rs index 0e556fb6..effdda7d 100644 --- a/zebra-script/src/lib.rs +++ b/zebra-script/src/lib.rs @@ -6,6 +6,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] // we allow unsafe code, so we can call zcash_script use std::{convert::TryInto, sync::Arc}; diff --git a/zebra-state/Cargo.toml b/zebra-state/Cargo.toml index 4290312c..92a969dd 100644 --- a/zebra-state/Cargo.toml +++ b/zebra-state/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-state" version = "1.0.0-beta.3" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [features] proptest-impl = ["proptest", "proptest-derive", "zebra-test"] diff --git a/zebra-state/src/lib.rs b/zebra-state/src/lib.rs index 3621509f..c01a633f 100644 --- a/zebra-state/src/lib.rs +++ b/zebra-state/src/lib.rs @@ -15,6 +15,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] #[cfg(any(test, feature = "proptest-impl"))] diff --git a/zebra-test/Cargo.toml b/zebra-test/Cargo.toml index 3278bf2b..fa21aefa 100644 --- a/zebra-test/Cargo.toml +++ b/zebra-test/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-test" version = "1.0.0-beta.3" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/zebra-test/src/lib.rs b/zebra-test/src/lib.rs index fb9d0f05..b1c30d03 100644 --- a/zebra-test/src/lib.rs +++ b/zebra-test/src/lib.rs @@ -6,6 +6,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] // Each lazy_static variable uses additional recursion #![recursion_limit = "512"] diff --git a/zebra-utils/Cargo.toml b/zebra-utils/Cargo.toml index e63426cd..3a472f73 100644 --- a/zebra-utils/Cargo.toml +++ b/zebra-utils/Cargo.toml @@ -3,7 +3,7 @@ name = "zebra-utils" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" version = "1.0.0-beta.3" -edition = "2018" +edition = "2021" # Prevent accidental publication of this utility crate. publish = false diff --git a/zebra-utils/src/lib.rs b/zebra-utils/src/lib.rs index 9d0c1a42..d619fb0d 100644 --- a/zebra-utils/src/lib.rs +++ b/zebra-utils/src/lib.rs @@ -8,4 +8,5 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index 6c47f503..35e4ba7e 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -3,7 +3,7 @@ name = "zebrad" authors = ["Zcash Foundation "] license = "MIT OR Apache-2.0" version = "1.0.0-beta.3" -edition = "2018" +edition = "2021" repository = "https://github.com/ZcashFoundation/zebra" # make `cargo run` use `zebrad` by default # when run in the workspace directory diff --git a/zebrad/src/lib.rs b/zebrad/src/lib.rs index ab9ec41b..cfa4ac62 100644 --- a/zebrad/src/lib.rs +++ b/zebrad/src/lib.rs @@ -21,6 +21,7 @@ #![warn(missing_docs)] #![allow(clippy::try_err)] #![deny(clippy::await_holding_lock)] +#![deny(rust_2021_compatibility)] #![forbid(unsafe_code)] // Tracing causes false positives on this lint: // https://github.com/tokio-rs/tracing/issues/553