From 1b6b3178941d0cfe09ad4dcdf08ba29f7beec580 Mon Sep 17 00:00:00 2001 From: Marek Mahut Date: Tue, 7 Apr 2020 12:09:26 +0200 Subject: [PATCH] wip: dump rust to unstable-2020-04-06 --- Makefile | 4 ++-- config.nix | 6 +++--- crates/core_types/build.rs | 2 +- crates/core_types/src/bits_n_pieces.rs | 4 ++-- crates/core_types/src/eav/storage.rs | 2 +- crates/core_types/src/error/ribosome_error.rs | 3 ++- crates/in_stream/src/mem.rs | 2 +- crates/sim2h/src/websocket/mem_stream.rs | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b2c111787d..81a1052265 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,8 @@ help: SHELL = /bin/bash CORE_RUST_VERSION ?= nightly-2019-07-14 TOOLS_RUST_VERSION ?= nightly-2019-07-14 -CARGO = RUSTFLAGS="-Z external-macro-backtrace -D warnings" RUST_BACKTRACE=1 rustup run $(CORE_RUST_VERSION) cargo $(CARGO_ARGS) -CARGO_TOOLS = RUSTFLAGS="-Z external-macro-backtrace -D warnings" RUST_BACKTRACE=1 rustup run $(TOOLS_RUST_VERSION) cargo $(CARGO_ARGS) +CARGO = RUSTFLAGS="-Z macro-backtrace -D warnings" RUST_BACKTRACE=1 rustup run $(CORE_RUST_VERSION) cargo $(CARGO_ARGS) +CARGO_TOOLS = RUSTFLAGS="-Z macro-backtrace -D warnings" RUST_BACKTRACE=1 rustup run $(TOOLS_RUST_VERSION) cargo $(CARGO_ARGS) CARGO_TARPULIN_INSTALL = RUSTFLAGS="--cfg procmacro2_semver_exempt -D warnings" RUST_BACKTRACE=1 cargo $(CARGO_ARGS) +$(CORE_RUST_VERSION) OPENSSL_STATIC = 1 diff --git a/config.nix b/config.nix index 74bb105594..3f06505427 100644 --- a/config.nix +++ b/config.nix @@ -5,8 +5,8 @@ let # tag will ultimately be current version when it hits holonix # https://github.com/holochain/holonix/blob/master/release/default.nix#L7 tag = "v${current}"; - holonix-version = "v0.0.72"; - holonix-sha256 = "090h5gqmfm40vkqhf1ky1n3ml24f5py04bvn50dkw0v8xzmsl4sk"; + holonix-version = "mmahut/rust"; + holonix-sha256 = "1yzs296jy4ci35k010x42780x4nm1m7rw0fpmy9f637yg13iimsi"; in rec { @@ -32,7 +32,7 @@ rec { sha256 = holonix-sha256; # the github owner of the holonix repo - owner = "holochain"; + owner = "mmahut"; # the name of the holonix repo repo = "holonix"; diff --git a/crates/core_types/build.rs b/crates/core_types/build.rs index c852af4b1c..349635d63c 100644 --- a/crates/core_types/build.rs +++ b/crates/core_types/build.rs @@ -28,7 +28,7 @@ fn main() { basename .split('-') .nth(0) - .and_then(|hash| Some(hash.to_string())) + .map(|hash| hash.to_string()) }) }) }) diff --git a/crates/core_types/src/bits_n_pieces.rs b/crates/core_types/src/bits_n_pieces.rs index 4d142a5c1e..b3ae1608b0 100644 --- a/crates/core_types/src/bits_n_pieces.rs +++ b/crates/core_types/src/bits_n_pieces.rs @@ -8,7 +8,7 @@ pub fn u32_high_bits(i: u32) -> u16 { /// returns the u16 low bits from a u32 by doing a lossy cast pub fn u32_low_bits(i: u32) -> u16 { - (i as u16) + i as u16 } /// splits the high and low bits of u32 into a tuple of u16, for destructuring convenience @@ -26,7 +26,7 @@ pub fn u64_high_bits(i: u64) -> u32 { } pub fn u64_low_bits(i: u64) -> u32 { - (i as u32) + i as u32 } pub fn u64_split_bits(i: u64) -> (u32, u32) { diff --git a/crates/core_types/src/eav/storage.rs b/crates/core_types/src/eav/storage.rs index edc77a9d5d..30f79ceaf8 100644 --- a/crates/core_types/src/eav/storage.rs +++ b/crates/core_types/src/eav/storage.rs @@ -81,7 +81,7 @@ pub fn increment_key_till_no_collision( map: BTreeSet, ) -> HcResult { if map.iter().any(|e| e.index() == eav.index()) { - let timestamp = eav.clone().index() + 1; + let timestamp = eav.index() + 1; eav.set_index(timestamp); increment_key_till_no_collision(eav, map) } else { diff --git a/crates/core_types/src/error/ribosome_error.rs b/crates/core_types/src/error/ribosome_error.rs index 51b3d36f5b..a443a89a03 100644 --- a/crates/core_types/src/error/ribosome_error.rs +++ b/crates/core_types/src/error/ribosome_error.rs @@ -240,7 +240,8 @@ impl RibosomeErrorCode { 10 => UnknownEntryType, 12 => EntryNotFound, 13 => WorkflowFailed, - 1 | _ => Unspecified, + 1 => Unspecified, + _ => Unspecified, } } diff --git a/crates/in_stream/src/mem.rs b/crates/in_stream/src/mem.rs index 0f70949cd9..72e8f99b89 100644 --- a/crates/in_stream/src/mem.rs +++ b/crates/in_stream/src/mem.rs @@ -356,7 +356,7 @@ impl MemManager { // this is the actual singleton global reference lazy_static! { static ref MEM_MANAGER: parking_lot::Mutex = - { parking_lot::Mutex::new(MemManager::new()) }; + parking_lot::Mutex::new(MemManager::new()); } fn get_mem_manager() -> parking_lot::MutexGuard<'static, MemManager> { diff --git a/crates/sim2h/src/websocket/mem_stream.rs b/crates/sim2h/src/websocket/mem_stream.rs index 6f5fb41eec..410136c9a1 100644 --- a/crates/sim2h/src/websocket/mem_stream.rs +++ b/crates/sim2h/src/websocket/mem_stream.rs @@ -275,7 +275,7 @@ impl MemManager { // this is the actual singleton global reference lazy_static! { - static ref MEM_MANAGER: GhostMutex = { GhostMutex::new(MemManager::new()) }; + static ref MEM_MANAGER: GhostMutex = GhostMutex::new(MemManager::new()); } #[cfg(test)]