From e922c2da9d64f7c72a41f172f9394bbdd46cda6a Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 30 Nov 2021 18:18:43 -0800 Subject: [PATCH] Update to Rust 1.56.1 --- ci/docker-rust-nightly/Dockerfile | 2 +- ci/docker-rust/Dockerfile | 2 +- ci/rust-version.sh | 4 ++-- cli/src/cluster_query.rs | 2 +- runtime/src/append_vec.rs | 1 - runtime/src/bank.rs | 20 ++++++++++---------- scripts/coverage.sh | 2 +- sdk/program/src/borsh.rs | 10 +++++----- 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/ci/docker-rust-nightly/Dockerfile b/ci/docker-rust-nightly/Dockerfile index 48bec8e70..2e5bac580 100644 --- a/ci/docker-rust-nightly/Dockerfile +++ b/ci/docker-rust-nightly/Dockerfile @@ -1,4 +1,4 @@ -FROM solanalabs/rust:1.56.0 +FROM solanalabs/rust:1.56.1 ARG date RUN set -x \ diff --git a/ci/docker-rust/Dockerfile b/ci/docker-rust/Dockerfile index 36c2f612d..5d768a81d 100644 --- a/ci/docker-rust/Dockerfile +++ b/ci/docker-rust/Dockerfile @@ -1,6 +1,6 @@ # Note: when the rust version is changed also modify # ci/rust-version.sh to pick up the new image tag -FROM rust:1.56.0 +FROM rust:1.56.1 # Add Google Protocol Buffers for Libra's metrics library. ENV PROTOC_VERSION 3.8.0 diff --git a/ci/rust-version.sh b/ci/rust-version.sh index 0d84b50f0..630afbac6 100644 --- a/ci/rust-version.sh +++ b/ci/rust-version.sh @@ -18,13 +18,13 @@ if [[ -n $RUST_STABLE_VERSION ]]; then stable_version="$RUST_STABLE_VERSION" else - stable_version=1.56.0 + stable_version=1.56.1 fi if [[ -n $RUST_NIGHTLY_VERSION ]]; then nightly_version="$RUST_NIGHTLY_VERSION" else - nightly_version=2021-10-22 + nightly_version=2021-11-30 fi diff --git a/cli/src/cluster_query.rs b/cli/src/cluster_query.rs index 2b572031c..2886ec26c 100644 --- a/cli/src/cluster_query.rs +++ b/cli/src/cluster_query.rs @@ -1431,7 +1431,7 @@ pub fn process_ping( if print_timestamp { format!("[{}.{:06}] ", micros / 1_000_000, micros % 1_000_000) } else { - format!("") + String::new() } }; diff --git a/runtime/src/append_vec.rs b/runtime/src/append_vec.rs index fc7bbb2bb..7811e91af 100644 --- a/runtime/src/append_vec.rs +++ b/runtime/src/append_vec.rs @@ -895,7 +895,6 @@ pub mod tests { // assert_eq! thinks *executable_bool is equal to false but the if condition thinks it's not, contradictorily. assert!(!*executable_bool); const FALSE: bool = false; // keep clippy happy - #[allow(clippy::if_then_panic)] if *executable_bool == FALSE { panic!("This didn't occur if this test passed."); } diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 9d059922d..864132160 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -8151,7 +8151,7 @@ pub(crate) mod tests { #[should_panic(expected = "range start is greater than range end in BTreeMap")] fn test_rent_eager_bad_range() { let test_map = map_to_test_bad_range(); - test_map.range( + let _ = test_map.range( Pubkey::new_from_array([ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8183,7 +8183,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); let range = Bank::pubkey_range_from_partition((1, 1, 3)); assert_eq!( @@ -8199,7 +8199,7 @@ pub(crate) mod tests { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]) ); - test_map.range(range); + let _ = test_map.range(range); let range = Bank::pubkey_range_from_partition((2, 2, 3)); assert_eq!( @@ -8215,7 +8215,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); } #[test] @@ -8236,7 +8236,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); let range = Bank::pubkey_range_from_partition((0, 1, 2)); assert_eq!( @@ -8252,7 +8252,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); } #[test] @@ -8274,7 +8274,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); let range = Bank::pubkey_range_from_partition((0, 1, 3)); assert_eq!( @@ -8290,7 +8290,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); let range = Bank::pubkey_range_from_partition((1, 2, 3)); assert_eq!( @@ -8306,7 +8306,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); } #[test] @@ -8328,7 +8328,7 @@ pub(crate) mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]) ); - test_map.range(range); + let _ = test_map.range(range); } impl Bank { diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 896d8f66c..fea0d79bf 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -10,7 +10,7 @@ if ! command -v grcov; then exit 1 fi -if [[ ! "$(grcov --version)" =~ 0.[678].[012] ]]; then +if [[ ! "$(grcov --version)" =~ 0.[678].[0124] ]]; then echo Error: Required grcov version not installed echo "Installed version: $(grcov --version)" diff --git a/sdk/program/src/borsh.rs b/sdk/program/src/borsh.rs index fdc0e2daf..d7d278234 100644 --- a/sdk/program/src/borsh.rs +++ b/sdk/program/src/borsh.rs @@ -120,8 +120,8 @@ mod tests { #[derive(PartialEq, Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema)] enum TestEnum { NoValue, - Value(u32), - StructValue { + Number(u32), + Struct { #[allow(dead_code)] number: u64, #[allow(dead_code)] @@ -204,7 +204,7 @@ mod tests { #[test] fn instance_packed_len_matches_packed_len() { - let enumeration = TestEnum::StructValue { + let enumeration = TestEnum::Struct { number: u64::MAX, array: [255; 8], }; @@ -278,9 +278,9 @@ mod tests { let string1 = "the first string, it's actually really really long".to_string(); let enum1 = TestEnum::NoValue; let string2 = "second string, shorter".to_string(); - let enum2 = TestEnum::Value(u32::MAX); + let enum2 = TestEnum::Number(u32::MAX); let string3 = "third".to_string(); - let enum3 = TestEnum::StructValue { + let enum3 = TestEnum::Struct { number: 0, array: [0; 8], };