Skip to content

Commit

Permalink
Upgrade to Rust 1.43.0 (#9754)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines authored Apr 30, 2020
1 parent 2f08b12 commit 230df0e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion ci/docker-rust-nightly/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM solanalabs/rust:1.42.0
FROM solanalabs/rust:1.43.0
ARG date

RUN set -x \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker-rust/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.42.0
FROM rust:1.43.0

# Add Google Protocol Buffers for Libra's metrics library.
ENV PROTOC_VERSION 3.8.0
Expand Down
24 changes: 15 additions & 9 deletions ci/rust-version.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
#
# This file maintains the rust versions for use by CI.
#
# Build with stable rust, updating the stable toolchain if necessary:
# $ source ci/rust-version.sh stable
# $ cargo +"$rust_stable" build
# Obtain the environment variables without any automatic toolchain updating:
# $ source ci/rust-version.sh
#
# Build with nightly rust, updating the nightly toolchain if necessary:
# Obtain the environment variables updating both stable and nightly, only stable, or
# only nightly:
# $ source ci/rust-version.sh all
# $ source ci/rust-version.sh stable
# $ source ci/rust-version.sh nightly

# Then to build with either stable or nightly:
# $ cargo +"$rust_stable" build
# $ cargo +"$rust_nightly" build
#
# Obtain the environment variables without any automatic toolchain updating:
# $ source ci/rust-version.sh
#

if [[ -n $RUST_STABLE_VERSION ]]; then
stable_version="$RUST_STABLE_VERSION"
else
stable_version=1.42.0
stable_version=1.43.0
fi

if [[ -n $RUST_NIGHTLY_VERSION ]]; then
nightly_version="$RUST_NIGHTLY_VERSION"
else
nightly_version=2020-03-12
nightly_version=2020-04-23
fi


Expand Down Expand Up @@ -51,6 +53,10 @@ export rust_nightly_docker_image=solanalabs/rust-nightly:"$nightly_version"
nightly)
rustup_install "$rust_nightly"
;;
all)
rustup_install "$rust_stable"
rustup_install "$rust_nightly"
;;
*)
echo "Note: ignoring unknown argument: $1"
;;
Expand Down
2 changes: 1 addition & 1 deletion ci/test-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ source ci/_
source ci/upload-ci-artifact.sh

eval "$(ci/channel-info.sh)"
source ci/rust-version.sh nightly
source ci/rust-version.sh all

set -o pipefail
export RUST_BACKTRACE=1
Expand Down
2 changes: 1 addition & 1 deletion core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ impl Validator {
"New shred signal for the TVU should be the same as the clear bank signal."
);

let vote_tracker = Arc::new({ VoteTracker::new(bank_forks.read().unwrap().root_bank()) });
let vote_tracker = Arc::new(VoteTracker::new(bank_forks.read().unwrap().root_bank()));

let (retransmit_slots_sender, retransmit_slots_receiver) = unbounded();
let tvu = Tvu::new(
Expand Down
2 changes: 1 addition & 1 deletion logger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::sync::{Arc, RwLock};

lazy_static! {
static ref LOGGER: Arc<RwLock<env_logger::Logger>> =
{ Arc::new(RwLock::new(env_logger::Logger::from_default_env())) };
Arc::new(RwLock::new(env_logger::Logger::from_default_env()));
}

struct LoggerShim {}
Expand Down
8 changes: 4 additions & 4 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub const DEFAULT_NUM_DIRS: u32 = 4;
lazy_static! {
// FROZEN_ACCOUNT_PANIC is used to signal local_cluster that an AccountsDB panic has occurred,
// as |cargo test| cannot observe panics in other threads
pub static ref FROZEN_ACCOUNT_PANIC: Arc<AtomicBool> = { Arc::new(AtomicBool::new(false)) };
pub static ref FROZEN_ACCOUNT_PANIC: Arc<AtomicBool> = Arc::new(AtomicBool::new(false));
}

#[derive(Debug, Default)]
Expand Down Expand Up @@ -3795,7 +3795,7 @@ pub mod tests {
assert_eq!(
vec![None, None, None],
(0..3)
.map({ |_| accounts.next_shrink_slot() })
.map(|_| accounts.next_shrink_slot())
.collect::<Vec<_>>()
);

Expand All @@ -3804,15 +3804,15 @@ pub mod tests {
assert_eq!(
vec![Some(7), Some(7), Some(7)],
(0..3)
.map({ |_| accounts.next_shrink_slot() })
.map(|_| accounts.next_shrink_slot())
.collect::<Vec<_>>()
);

current_slot += 1;
accounts.add_root(current_slot);

let slots = (0..6)
.map({ |_| accounts.next_shrink_slot() })
.map(|_| accounts.next_shrink_slot())
.collect::<Vec<_>>();

// Because the origin of this data is HashMap (not BTreeMap), key order is arbitrary per cycle.
Expand Down

0 comments on commit 230df0e

Please sign in to comment.