Skip to content

Commit

Permalink
upgrade rust to 1.37 (solana-labs#5611)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-solana authored Aug 23, 2019
1 parent aeaa0fe commit 52f6da5
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ os:
language: rust
cache: cargo
rust:
- 1.36.0
- 1.37.0

install:
- source ci/rust-version.sh
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ $ source $HOME/.cargo/env
$ rustup component add rustfmt
```

If your rustc version is lower than 1.36.0, please update it:
If your rustc version is lower than 1.37.0, please update it:

```bash
$ rustup update
Expand Down Expand Up @@ -240,5 +240,3 @@ problem is solved by this code?" On the other hand, if a test does fail and you
better way to solve the same problem, a Pull Request with your solution would most certainly be
welcome! Likewise, if rewriting a test can better communicate what code it's protecting, please
send us that patch!
5 changes: 1 addition & 4 deletions 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.36.0
FROM rust:1.37.0

# Add Google Protocol Buffers for Libra's metrics library.
ENV PROTOC_VERSION 3.8.0
Expand All @@ -10,17 +10,14 @@ RUN set -x \
&& apt update \
&& apt-get install apt-transport-https \
&& echo deb https://apt.buildkite.com/buildkite-agent stable main > /etc/apt/sources.list.d/buildkite-agent.list \
&& echo deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-7 main > /etc/apt/sources.list.d/llvm.list \
&& apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32A37959C2FA5C3C99EFBC32A79206696452D198 \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& apt update \
&& apt install -y \
buildkite-agent \
clang-7 \
cmake \
lcov \
libclang-common-7-dev \
llvm-7 \
mscgen \
rsync \
sudo \
Expand Down
4 changes: 2 additions & 2 deletions ci/rust-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# $ source ci/rust-version.sh
#

stable_version=1.36.0
nightly_version=2019-07-19
stable_version=1.37.0
nightly_version=2019-08-21

export rust_stable="$stable_version"
export rust_stable_docker_image=solanalabs/rust:"$stable_version"
Expand Down
2 changes: 1 addition & 1 deletion ci/test-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _ cargo +"$rust_stable" clippy --version
_ cargo +"$rust_stable" clippy --all --exclude solana-sdk-c -- --deny=warnings
_ cargo +"$rust_stable" clippy --manifest-path sdk-c/Cargo.toml -- --deny=warnings

_ cargo +"$rust_stable" audit --version
# _ cargo +"$rust_stable" audit --version ### cargo-audit stopped supporting --version?? https://github.com/RustSec/cargo-audit/issues/100
_ cargo +"$rust_stable" audit
_ ci/nits.sh
_ ci/order-crates-for-publishing.py
Expand Down
2 changes: 2 additions & 0 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ impl BankingStage {
if processed < verified_txs_len {
let next_leader = poh_recorder.lock().unwrap().next_slot_leader();
// Walk thru rest of the transactions and filter out the invalid (e.g. too old) ones
#[allow(clippy::while_let_on_iterator)]
while let Some((msgs, unprocessed_indexes)) = buffered_packets_iter.next() {
let unprocessed_indexes = Self::filter_unprocessed_packets(
&bank,
Expand Down Expand Up @@ -849,6 +850,7 @@ impl BankingStage {
if processed < verified_txs_len {
let next_leader = poh.lock().unwrap().next_slot_leader();
// Walk thru rest of the transactions and filter out the invalid (e.g. too old) ones
#[allow(clippy::while_let_on_iterator)]
while let Some((msgs, vers)) = mms_iter.next() {
let packet_indexes = Self::generate_packet_indexes(vers);
let unprocessed_indexes = Self::filter_unprocessed_packets(
Expand Down
2 changes: 1 addition & 1 deletion core/src/replicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use std::sync::{Arc, RwLock};
use std::thread::{sleep, spawn, JoinHandle};
use std::time::Duration;

static ENCRYPTED_FILENAME: &'static str = "ledger.enc";
static ENCRYPTED_FILENAME: &str = "ledger.enc";

#[derive(Serialize, Deserialize)]
pub enum ReplicatorRequest {
Expand Down
1 change: 1 addition & 0 deletions core/src/rpc_pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use solana_sdk::signature::Signature;
use solana_sdk::transaction;
use std::sync::{atomic, Arc};

#[allow(clippy::needless_return)] // TODO remove me when rpc is updated?
#[rpc(server)]
pub trait RpcSolPubSub {
type Metadata;
Expand Down
4 changes: 2 additions & 2 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ impl Default for ValidatorConfig {

#[derive(Default)]
pub struct ValidatorExit {
exits: Vec<Box<FnOnce() + Send + Sync>>,
exits: Vec<Box<dyn FnOnce() + Send + Sync>>,
}

impl ValidatorExit {
pub fn register_exit(&mut self, exit: Box<FnOnce() -> () + Send + Sync>) {
pub fn register_exit(&mut self, exit: Box<dyn FnOnce() -> () + Send + Sync>) {
self.exits.push(exit);
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ impl<T: Clone> AccountsIndex<T> {
);
fork_vec.retain(|(fork, _)| !Self::can_purge(max_root, *fork));

return None;
None
} else {
return Some(account_info);
Some(account_info)
}
}

Expand Down

0 comments on commit 52f6da5

Please sign in to comment.