From b7b36bb0a432d756450bbf6f8d501f80f2b5fdfd Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 13 Mar 2020 13:15:22 -0700 Subject: [PATCH] Upgrade to Rust 1.42 (#8836) * Upgrade to Rust 1.42 * deref * parens Co-authored-by: Trent Nelson --- ci/docker-rust-nightly/Dockerfile | 2 +- ci/docker-rust-nightly/README.md | 2 ++ ci/docker-rust/Dockerfile | 2 +- ci/rust-version.sh | 4 ++-- ledger/src/blockstore.rs | 2 +- runtime/src/bank.rs | 2 +- runtime/src/transaction_batch.rs | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ci/docker-rust-nightly/Dockerfile b/ci/docker-rust-nightly/Dockerfile index 1e3438cc7..1ddc1f225 100644 --- a/ci/docker-rust-nightly/Dockerfile +++ b/ci/docker-rust-nightly/Dockerfile @@ -1,4 +1,4 @@ -FROM solanalabs/rust:1.41.1 +FROM solanalabs/rust:1.42.0 ARG date RUN set -x \ diff --git a/ci/docker-rust-nightly/README.md b/ci/docker-rust-nightly/README.md index a40aa6101..1f3bdc945 100644 --- a/ci/docker-rust-nightly/README.md +++ b/ci/docker-rust-nightly/README.md @@ -15,6 +15,8 @@ To update the pinned version: 1. Run `ci/docker-rust-nightly/build.sh` to rebuild the nightly image locally, or potentially `ci/docker-rust-nightly/build.sh YYYY-MM-DD` if there's a specific YYYY-MM-DD that is desired (default is today's build). + Check https://rust-lang.github.io/rustup-components-history/ for build + status 1. Update `ci/rust-version.sh` to reflect the new nightly `YYY-MM-DD` 1. Run `SOLANA_DOCKER_RUN_NOSETUID=1 ci/docker-run.sh --nopull solanalabs/rust-nightly:YYYY-MM-DD ci/test-coverage.sh` to confirm the new nightly image builds. Fix any issues as needed diff --git a/ci/docker-rust/Dockerfile b/ci/docker-rust/Dockerfile index 4f066bef0..68827520e 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.41.1 +FROM rust:1.42.0 # 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 c82e17710..f338a340a 100644 --- a/ci/rust-version.sh +++ b/ci/rust-version.sh @@ -16,13 +16,13 @@ if [[ -n $RUST_STABLE_VERSION ]]; then stable_version="$RUST_STABLE_VERSION" else - stable_version=1.41.1 + stable_version=1.42.0 fi if [[ -n $RUST_NIGHTLY_VERSION ]]; then nightly_version="$RUST_NIGHTLY_VERSION" else - nightly_version=2020-02-27 + nightly_version=2020-03-12 fi diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 859c56aeb..954bfe28d 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -3947,7 +3947,7 @@ pub mod tests { .flat_map(|k| { let begin = k * gap + 1; let end = (k + 1) * gap; - (begin..end) + begin..end }) .collect(); assert_eq!( diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 31b5b2f89..5d92c3b26 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -1005,7 +1005,7 @@ impl Bank { let results = self .rc .accounts - .lock_accounts(txs, iteration_order.as_ref().map(|v| v.as_slice())); + .lock_accounts(txs, iteration_order.as_deref()); TransactionBatch::new(results, &self, txs, iteration_order) } diff --git a/runtime/src/transaction_batch.rs b/runtime/src/transaction_batch.rs index 61c9fda2b..597de3627 100644 --- a/runtime/src/transaction_batch.rs +++ b/runtime/src/transaction_batch.rs @@ -39,7 +39,7 @@ impl<'a, 'b> TransactionBatch<'a, 'b> { } pub fn iteration_order(&self) -> Option<&[usize]> { - self.iteration_order.as_ref().map(|v| v.as_slice()) + self.iteration_order.as_deref() } pub fn bank(&self) -> &Bank { self.bank