From 16ba52d8a488b59f4de5d2112757aea49f7e8ed3 Mon Sep 17 00:00:00 2001 From: Emma Turner Date: Wed, 26 Jun 2024 16:09:19 +0100 Subject: [PATCH] bump: MSRV -> 1.64.0 Required as we start to make use of workspace inheritance in the Cargo.toml files for dependencies --- .cargo/{config => config.toml} | 0 .github/workflows/build.yml | 14 +++++++------- .github/workflows/clippy.yml | 2 +- .github/workflows/rustfmt.yml | 4 ++-- CHANGELOG.md | 1 + Cargo.toml | 1 + crypto/Cargo.toml | 2 +- crypto/src/blake2b.rs | 2 +- crypto/src/hash.rs | 2 +- tezos-encoding-derive/Cargo.toml | 2 +- tezos-encoding-derive/src/encoding.rs | 2 +- tezos-encoding/Cargo.toml | 2 +- tezos-encoding/src/bit_utils.rs | 2 +- tezos-encoding/src/enc.rs | 2 +- tezos-encoding/src/nom.rs | 4 ++-- 15 files changed, 22 insertions(+), 20 deletions(-) rename .cargo/{config => config.toml} (100%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c39338ea69..cad0e9335e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup Rust (regular) if: matrix.sanitizer != 'address' - uses: dtolnay/rust-toolchain@1.61.0 + uses: dtolnay/rust-toolchain@1.64.0 with: target: wasm32-unknown-unknown - name: Setup Rust (for sanitizer) @@ -32,15 +32,15 @@ jobs: - name: Settings for cargo in Linux if: matrix.sanitizer == 'address' run: | - echo '[build]' >> ~/.cargo/config - echo 'rustflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config - echo 'rustdocflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config - echo 'target = "x86_64-unknown-linux-gnu"' >> ~/.cargo/config + echo '[build]' >> ~/.cargo/config.toml + echo 'rustflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config.toml + echo 'rustdocflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config.toml + echo 'target = "x86_64-unknown-linux-gnu"' >> ~/.cargo/config.toml - name: Settings for cargo in OSX if: runner.os == 'macOS' run: | - echo '[build]' >> ~/.cargo/config - echo 'rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]' >> ~/.cargo/config + echo '[build]' >> ~/.cargo/config.toml + echo 'rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]' >> ~/.cargo/config.toml - name: APT dependencies if: runner.os == 'Linux' run: | diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 47f49a2c6c..63630dac0b 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.61.0 + - uses: dtolnay/rust-toolchain@1.64.0 with: components: clippy - name: lint diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 5fed567fac..fa29b31627 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -11,8 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.61.0 + - uses: dtolnay/rust-toolchain@1.64.0 with: components: rustfmt - name: check formatting - run: cargo fmt --all -- --check \ No newline at end of file + run: cargo fmt --all -- --check diff --git a/CHANGELOG.md b/CHANGELOG.md index a47c452702..5eef2a73b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ parameterized by the lifetime of the input byte slice. - `PublicKeySignatureVerifier` now requires the explicitly correct signature kind for the given public key. - Update `blst` dependency to `0.3.12` to improve RISC-V compatibility. - Update `num-bigint` dependency to `0.4` to improve WASM compatibility. +- Minimum supported rust version bumped to `1.64`. ### Deprecated diff --git a/Cargo.toml b/Cargo.toml index c60ad9ac0b..d1cc3e3fcb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ cargo-features = ["named-profiles"] [workspace] +resolver = "2" members = [ "crypto", "tezos-encoding", diff --git a/crypto/Cargo.toml b/crypto/Cargo.toml index 3a884e2922..c2529fbf58 100644 --- a/crypto/Cargo.toml +++ b/crypto/Cargo.toml @@ -3,7 +3,7 @@ name = "tezos_crypto_rs" version = "0.5.2" authors = ["TriliTech "] edition = "2021" -rust-version = "1.60" +rust-version = "1.64" license = "MIT" keywords = ["tezos"] categories = ["cryptography::cryptocurrencies"] diff --git a/crypto/src/blake2b.rs b/crypto/src/blake2b.rs index c79de57461..058f10e599 100644 --- a/crypto/src/blake2b.rs +++ b/crypto/src/blake2b.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; #[cfg_attr(feature = "fuzzing", derive(fuzzcheck::DefaultMutator))] -#[derive(Serialize, Deserialize, Error, Debug, PartialEq, Clone, Copy)] +#[derive(Serialize, Deserialize, Error, Debug, PartialEq, Eq, Clone, Copy)] pub enum Blake2bError { #[error("Output digest length must be between 16 and 64 bytes.")] InvalidLength, diff --git a/crypto/src/hash.rs b/crypto/src/hash.rs index 50acd84548..b1c1660739 100644 --- a/crypto/src/hash.rs +++ b/crypto/src/hash.rs @@ -339,7 +339,7 @@ unknown_sig!(Secp256k1Signature); unknown_sig!(P256Signature); /// Note: see Tezos ocaml lib_crypto/base58.ml -#[derive(Debug, Copy, Clone, PartialEq, strum_macros::AsRefStr)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, strum_macros::AsRefStr)] pub enum HashType { // "\087\082\000" (* Net(15) *) ChainId, diff --git a/tezos-encoding-derive/Cargo.toml b/tezos-encoding-derive/Cargo.toml index 105edaf5f8..3f1255fc7d 100644 --- a/tezos-encoding-derive/Cargo.toml +++ b/tezos-encoding-derive/Cargo.toml @@ -3,7 +3,7 @@ name = "tezos_data_encoding_derive" version = "0.5.2" authors = ["TriliTech "] edition = "2021" -rust-version = "1.60" +rust-version = "1.64" license = "MIT" keywords = ["tezos"] categories = ["encoding"] diff --git a/tezos-encoding-derive/src/encoding.rs b/tezos-encoding-derive/src/encoding.rs index 4d2cfcdeb6..48ae16c611 100644 --- a/tezos-encoding-derive/src/encoding.rs +++ b/tezos-encoding-derive/src/encoding.rs @@ -83,7 +83,7 @@ pub enum Encoding<'a> { Dynamic(Option, Box>, Span), } -#[derive(Clone, Copy, Debug, PartialEq, Display, FromStr)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Display, FromStr)] pub enum PrimitiveEncoding { Int8, Uint8, diff --git a/tezos-encoding/Cargo.toml b/tezos-encoding/Cargo.toml index 947a52f24a..a47dc631dc 100644 --- a/tezos-encoding/Cargo.toml +++ b/tezos-encoding/Cargo.toml @@ -3,7 +3,7 @@ name = "tezos_data_encoding" version = "0.5.2" authors = ["TriliTech "] edition = "2021" -rust-version = "1.60" +rust-version = "1.64" license = "MIT" keywords = ["tezos"] categories = ["encoding"] diff --git a/tezos-encoding/src/bit_utils.rs b/tezos-encoding/src/bit_utils.rs index ea937a7341..54365264f7 100644 --- a/tezos-encoding/src/bit_utils.rs +++ b/tezos-encoding/src/bit_utils.rs @@ -9,7 +9,7 @@ use bit_vec::BitVec; use thiserror::Error; /// An error triggered when working with [Bits]. -#[derive(Debug, Error, PartialEq)] +#[derive(Debug, Error, PartialEq, Eq)] pub enum BitsError { /// Index is out of range #[error("index out of range")] diff --git a/tezos-encoding/src/enc.rs b/tezos-encoding/src/enc.rs index 8bcfc73cea..78ffd483a4 100644 --- a/tezos-encoding/src/enc.rs +++ b/tezos-encoding/src/enc.rs @@ -173,7 +173,7 @@ where T: ?Sized + BinWriter, { fn bin_write(&self, output: &mut Vec) -> BinResult { - (&**self).bin_write(output) + (**self).bin_write(output) } } diff --git a/tezos-encoding/src/nom.rs b/tezos-encoding/src/nom.rs index 15c0369b4e..ca99b2b79b 100644 --- a/tezos-encoding/src/nom.rs +++ b/tezos-encoding/src/nom.rs @@ -47,7 +47,7 @@ pub mod error { } /// Decoding error kind. - #[derive(Debug, PartialEq)] + #[derive(Debug, PartialEq, Eq)] pub enum DecodeErrorKind { /// Nom-specific error. Nom(ErrorKind), @@ -68,7 +68,7 @@ pub mod error { } /// Specific bounded encoding kind. - #[derive(Debug, PartialEq, Clone)] + #[derive(Debug, PartialEq, Eq, Clone)] pub enum BoundedEncodingKind { String, List,