diff --git a/ci/docker-rust-nightly/Dockerfile b/ci/docker-rust-nightly/Dockerfile index 86adea5ddf619c..d463de2db4cf08 100644 --- a/ci/docker-rust-nightly/Dockerfile +++ b/ci/docker-rust-nightly/Dockerfile @@ -1,4 +1,4 @@ -FROM solanalabs/rust:1.48.0 +FROM solanalabs/rust:1.49.0 ARG date RUN set -x \ diff --git a/ci/docker-rust/Dockerfile b/ci/docker-rust/Dockerfile index 74c992e78fc47f..26aafdabed89ae 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.48.0 +FROM rust:1.49.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 14c76ddd1f6bfb..7dc982fae60cf2 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.48.0 + stable_version=1.49.0 fi if [[ -n $RUST_NIGHTLY_VERSION ]]; then nightly_version="$RUST_NIGHTLY_VERSION" else - nightly_version=2020-12-13 + nightly_version=2021-01-23 fi diff --git a/clap-utils/src/input_parsers.rs b/clap-utils/src/input_parsers.rs index 1fb52747652652..50ba489cecd3f6 100644 --- a/clap-utils/src/input_parsers.rs +++ b/clap-utils/src/input_parsers.rs @@ -167,12 +167,12 @@ pub fn resolve_signer( name: &str, wallet_manager: &mut Option>, ) -> Result, Box> { - Ok(resolve_signer_from_path( + resolve_signer_from_path( matches, matches.value_of(name).unwrap(), name, wallet_manager, - )?) + ) } pub fn lamports_of_sol(matches: &ArgMatches<'_>, name: &str) -> Option { diff --git a/client/src/client_error.rs b/client/src/client_error.rs index 043a706960d456..96f66602627213 100644 --- a/client/src/client_error.rs +++ b/client/src/client_error.rs @@ -35,16 +35,16 @@ impl From for ClientErrorKind { } } -impl Into for ClientErrorKind { - fn into(self) -> TransportError { - match self { - Self::Io(err) => TransportError::IoError(err), - Self::TransactionError(err) => TransportError::TransactionError(err), - Self::Reqwest(err) => TransportError::Custom(format!("{:?}", err)), - Self::RpcError(err) => TransportError::Custom(format!("{:?}", err)), - Self::SerdeJson(err) => TransportError::Custom(format!("{:?}", err)), - Self::SigningError(err) => TransportError::Custom(format!("{:?}", err)), - Self::Custom(err) => TransportError::Custom(format!("{:?}", err)), +impl From for TransportError { + fn from(client_error_kind: ClientErrorKind) -> Self { + match client_error_kind { + ClientErrorKind::Io(err) => Self::IoError(err), + ClientErrorKind::TransactionError(err) => Self::TransactionError(err), + ClientErrorKind::Reqwest(err) => Self::Custom(format!("{:?}", err)), + ClientErrorKind::RpcError(err) => Self::Custom(format!("{:?}", err)), + ClientErrorKind::SerdeJson(err) => Self::Custom(format!("{:?}", err)), + ClientErrorKind::SigningError(err) => Self::Custom(format!("{:?}", err)), + ClientErrorKind::Custom(err) => Self::Custom(format!("{:?}", err)), } } } @@ -100,9 +100,9 @@ impl From for ClientError { } } -impl Into for ClientError { - fn into(self) -> TransportError { - self.kind.into() +impl From for TransportError { + fn from(client_error: ClientError) -> Self { + client_error.kind.into() } } diff --git a/core/src/broadcast_stage.rs b/core/src/broadcast_stage.rs index 86b28d442e39fb..012a92c7a841ed 100644 --- a/core/src/broadcast_stage.rs +++ b/core/src/broadcast_stage.rs @@ -347,6 +347,7 @@ fn update_peer_stats( ) { let now = timestamp(); let last = last_datapoint_submit.load(Ordering::Relaxed); + #[allow(deprecated)] if now.saturating_sub(last) > 1000 && last_datapoint_submit.compare_and_swap(last, now, Ordering::Relaxed) == last { diff --git a/core/src/broadcast_stage/standard_broadcast_run.rs b/core/src/broadcast_stage/standard_broadcast_run.rs index fa91dcd9e61da1..2b1676aff0eac3 100644 --- a/core/src/broadcast_stage/standard_broadcast_run.rs +++ b/core/src/broadcast_stage/standard_broadcast_run.rs @@ -329,6 +329,7 @@ impl StandardBroadcastRun { let mut get_peers_time = Measure::start("broadcast::get_peers"); let now = timestamp(); let last = self.last_peer_update.load(Ordering::Relaxed); + #[allow(deprecated)] if now - last > BROADCAST_PEER_UPDATE_INTERVAL_MS && self .last_peer_update diff --git a/core/src/cluster_info_vote_listener.rs b/core/src/cluster_info_vote_listener.rs index fe55f529f38d95..d03956690c22ca 100644 --- a/core/src/cluster_info_vote_listener.rs +++ b/core/src/cluster_info_vote_listener.rs @@ -403,6 +403,7 @@ impl ClusterInfoVoteListener { let last_version = bank.last_vote_sync.load(Ordering::Relaxed); let (new_version, msgs) = verified_vote_packets.get_latest_votes(last_version); verified_packets_sender.send(msgs)?; + #[allow(deprecated)] bank.last_vote_sync.compare_and_swap( last_version, new_version, diff --git a/core/src/commitment_service.rs b/core/src/commitment_service.rs index 43592889ca8dbc..6249d1f57b0858 100644 --- a/core/src/commitment_service.rs +++ b/core/src/commitment_service.rs @@ -263,15 +263,9 @@ mod tests { #[test] fn test_get_highest_confirmed_root() { assert_eq!(get_highest_confirmed_root(vec![], 10), 0); - let mut rooted_stake = vec![]; - rooted_stake.push((0, 5)); - rooted_stake.push((1, 5)); + let rooted_stake = vec![(0, 5), (1, 5)]; assert_eq!(get_highest_confirmed_root(rooted_stake, 10), 0); - let mut rooted_stake = vec![]; - rooted_stake.push((1, 5)); - rooted_stake.push((0, 10)); - rooted_stake.push((2, 5)); - rooted_stake.push((1, 4)); + let rooted_stake = vec![(1, 5), (0, 10), (2, 5), (1, 4)]; assert_eq!(get_highest_confirmed_root(rooted_stake, 10), 1); } diff --git a/core/src/crds_gossip_pull.rs b/core/src/crds_gossip_pull.rs index 189c162720b6f8..0ad6d045e36e09 100644 --- a/core/src/crds_gossip_pull.rs +++ b/core/src/crds_gossip_pull.rs @@ -145,10 +145,10 @@ impl CrdsFilterSet { } } -impl Into> for CrdsFilterSet { - fn into(self) -> Vec { - let mask_bits = self.mask_bits; - self.filters +impl From for Vec { + fn from(cfs: CrdsFilterSet) -> Self { + let mask_bits = cfs.mask_bits; + cfs.filters .into_iter() .enumerate() .map(|(seed, filter)| CrdsFilter { diff --git a/core/src/crds_value.rs b/core/src/crds_value.rs index c5e6a57416d86f..7d5efcf21ffb19 100644 --- a/core/src/crds_value.rs +++ b/core/src/crds_value.rs @@ -303,7 +303,7 @@ impl<'de> Deserialize<'de> for Vote { from: Pubkey, transaction: Transaction, wallclock: u64, - }; + } let vote = Vote::deserialize(deserializer)?; let vote = match vote.transaction.sanitize() { Ok(_) => Self::new(vote.from, vote.transaction, vote.wallclock), diff --git a/core/src/poh_service.rs b/core/src/poh_service.rs index fc97b527ae0427..8d94fbeb59450b 100644 --- a/core/src/poh_service.rs +++ b/core/src/poh_service.rs @@ -125,7 +125,7 @@ impl PohService { // sleep is not accurate enough to get a predictable time. // Kernel can not schedule the thread for a while. while (now.elapsed().as_nanos() as u64) < target_tick_ns { - std::sync::atomic::spin_loop_hint(); + std::hint::spin_loop(); } total_sleep_us += (now.elapsed().as_nanos() as u64 - elapsed_ns) / 1000; now = Instant::now(); diff --git a/core/src/retransmit_stage.rs b/core/src/retransmit_stage.rs index 331b4539419623..9977f7c18d6c7f 100644 --- a/core/src/retransmit_stage.rs +++ b/core/src/retransmit_stage.rs @@ -121,6 +121,7 @@ fn update_retransmit_stats( let now = timestamp(); let last = stats.last_ts.load(Ordering::Relaxed); + #[allow(deprecated)] if now.saturating_sub(last) > 2000 && stats.last_ts.compare_and_swap(last, now, Ordering::Relaxed) == last { @@ -310,6 +311,7 @@ fn retransmit( let now = timestamp(); let last = last_peer_update.load(Ordering::Relaxed); + #[allow(deprecated)] if now.saturating_sub(last) > 1000 && last_peer_update.compare_and_swap(last, now, Ordering::Relaxed) == last { diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 38837060171ee3..b39a6291532095 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -749,7 +749,7 @@ impl JsonRpcRequestProcessor { // If the starting slot is lower than what's available in blockstore assume the entire // [start_slot..end_slot] can be fetched from BigTable. if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - return Ok(self + return self .runtime_handle .block_on( bigtable_ledger_storage @@ -764,7 +764,7 @@ impl JsonRpcRequestProcessor { "BigTable query failed (maybe timeout due to too large range?)" .to_string(), ) - })?); + }); } } diff --git a/core/src/tpu.rs b/core/src/tpu.rs index 253748f58ea7a3..c26a8e18b319ec 100644 --- a/core/src/tpu.rs +++ b/core/src/tpu.rs @@ -119,11 +119,12 @@ impl Tpu { } pub fn join(self) -> thread::Result<()> { - let mut results = vec![]; - results.push(self.fetch_stage.join()); - results.push(self.sigverify_stage.join()); - results.push(self.cluster_info_vote_listener.join()); - results.push(self.banking_stage.join()); + let results = vec![ + self.fetch_stage.join(), + self.sigverify_stage.join(), + self.cluster_info_vote_listener.join(), + self.banking_stage.join(), + ]; let broadcast_result = self.broadcast_stage.join(); for result in results { result?; diff --git a/frozen-abi/macro/src/lib.rs b/frozen-abi/macro/src/lib.rs index 83316cca1d0665..8243068222bba8 100644 --- a/frozen-abi/macro/src/lib.rs +++ b/frozen-abi/macro/src/lib.rs @@ -78,6 +78,7 @@ fn quote_for_specialization_detection() -> TokenStream2 { std::sync::atomic::AtomicBool::new(false); } + #[allow(deprecated)] if !SPECIALIZATION_DETECTOR_INJECTED.compare_and_swap( false, true, diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index c16d9eb3c08ab8..6cdd306795b68b 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -645,7 +645,7 @@ fn hardforks_of(matches: &ArgMatches<'_>, name: &str) -> Option> { fn load_bank_forks( arg_matches: &ArgMatches, - ledger_path: &PathBuf, + ledger_path: &Path, genesis_config: &GenesisConfig, process_options: ProcessOptions, access_type: AccessType, @@ -653,7 +653,7 @@ fn load_bank_forks( snapshot_archive_path: Option, ) -> bank_forks_utils::LoadResult { let blockstore = open_blockstore(&ledger_path, access_type, wal_recovery_mode); - let snapshot_path = ledger_path.clone().join(if blockstore.is_primary_access() { + let snapshot_path = ledger_path.join(if blockstore.is_primary_access() { "snapshot" } else { "snapshot.ledger-tool" @@ -662,7 +662,7 @@ fn load_bank_forks( None } else { let snapshot_package_output_path = - snapshot_archive_path.unwrap_or_else(|| ledger_path.clone()); + snapshot_archive_path.unwrap_or_else(|| ledger_path.to_path_buf()); Some(SnapshotConfig { snapshot_interval_slots: 0, // Value doesn't matter snapshot_package_output_path, @@ -1443,7 +1443,7 @@ fn main() { last_in_slot: bool, data_complete: bool, shred: &'a Shred, - }; + } let starting_slot = value_t_or_exit!(arg_matches, "starting_slot", Slot); let ending_slot = value_t!(arg_matches, "ending_slot", Slot).unwrap_or(Slot::MAX); let ledger = open_blockstore(&ledger_path, AccessType::TryPrimaryThenSecondary, None); @@ -2442,13 +2442,13 @@ fn main() { cluster_points: String, old_capitalization: u64, new_capitalization: u64, - }; + } fn format_or_na( data: Option, ) -> String { data.map(|data| format!("{}", data)) .unwrap_or_else(|| "N/A".to_owned()) - }; + } let mut point_details = detail .map(|d| d.points.iter().map(Some).collect::>()) .unwrap_or_default(); diff --git a/ledger/src/blockstore_db.rs b/ledger/src/blockstore_db.rs index a6db8f2ace98e1..12cd3a4d34b976 100644 --- a/ledger/src/blockstore_db.rs +++ b/ledger/src/blockstore_db.rs @@ -185,9 +185,10 @@ impl From<&str> for BlockstoreRecoveryMode { } } } -impl Into for BlockstoreRecoveryMode { - fn into(self) -> DBRecoveryMode { - match self { + +impl From for DBRecoveryMode { + fn from(brm: BlockstoreRecoveryMode) -> Self { + match brm { BlockstoreRecoveryMode::TolerateCorruptedTailRecords => { DBRecoveryMode::TolerateCorruptedTailRecords } @@ -404,6 +405,7 @@ pub trait Column { fn key(index: Self::Index) -> Vec; fn index(key: &[u8]) -> Self::Index; fn primary_index(index: Self::Index) -> Slot; + #[allow(clippy::wrong_self_convention)] fn as_index(slot: Slot) -> Self::Index; } diff --git a/metrics/src/counter.rs b/metrics/src/counter.rs index 661d00be4b18de..787cc8f38653b3 100644 --- a/metrics/src/counter.rs +++ b/metrics/src/counter.rs @@ -164,6 +164,7 @@ impl Counter { } } pub fn init(&mut self) { + #![allow(deprecated)] self.lograte .compare_and_swap(0, Self::default_log_rate(), Ordering::Relaxed); self.metricsrate @@ -188,6 +189,7 @@ impl Counter { } let lastlog = self.lastlog.load(Ordering::Relaxed); + #[allow(deprecated)] let prev = self .lastlog .compare_and_swap(lastlog, counts, Ordering::Relaxed); diff --git a/metrics/src/metrics.rs b/metrics/src/metrics.rs index ee0a37bd290fab..4484e8220bfa24 100644 --- a/metrics/src/metrics.rs +++ b/metrics/src/metrics.rs @@ -19,11 +19,11 @@ use std::{ type CounterMap = HashMap<(&'static str, u64), CounterPoint>; -impl Into for CounterPoint { - fn into(self) -> DataPoint { - let mut point = DataPoint::new(self.name); - point.timestamp = self.timestamp; - point.add_field_i64("count", self.count); +impl From for DataPoint { + fn from(counter_point: CounterPoint) -> Self { + let mut point = Self::new(counter_point.name); + point.timestamp = counter_point.timestamp; + point.add_field_i64("count", counter_point.count); point } } diff --git a/perf/src/cuda_runtime.rs b/perf/src/cuda_runtime.rs index f59f96217aa31f..dc9b84a0395ca2 100644 --- a/perf/src/cuda_runtime.rs +++ b/perf/src/cuda_runtime.rs @@ -89,18 +89,17 @@ impl Default for PinnedVec { } } -impl Into> for PinnedVec { - fn into(mut self) -> Vec { - if self.pinned { - unpin(self.x.as_mut_ptr()); - self.pinned = false; +impl From> for Vec { + fn from(mut pinned_vec: PinnedVec) -> Self { + if pinned_vec.pinned { + unpin(pinned_vec.x.as_mut_ptr()); + pinned_vec.pinned = false; } - self.pinnable = false; - self.recycler = None; - std::mem::take(&mut self.x) + pinned_vec.pinnable = false; + pinned_vec.recycler = None; + std::mem::take(&mut pinned_vec.x) } } - pub struct PinnedIter<'a, T>(std::slice::Iter<'a, T>); pub struct PinnedIterMut<'a, T>(std::slice::IterMut<'a, T>); diff --git a/perf/src/recycler.rs b/perf/src/recycler.rs index 40dc09217e7aae..1d94d8e4e216e9 100644 --- a/perf/src/recycler.rs +++ b/perf/src/recycler.rs @@ -114,9 +114,12 @@ impl RecyclerX { let max_gc = self.stats.max_gc.load(Ordering::Relaxed); if len > max_gc { // this is not completely accurate, but for most cases should be fine. - self.stats - .max_gc - .compare_and_swap(max_gc, len, Ordering::Relaxed); + let _ = self.stats.max_gc.compare_exchange( + max_gc, + len, + Ordering::Relaxed, + Ordering::Relaxed, + ); } let total = self.stats.total.load(Ordering::Relaxed); let reuse = self.stats.reuse.load(Ordering::Relaxed); diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index b285aca780f310..c3477fdb767f73 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -3908,6 +3908,8 @@ impl AccountsDB { fn report_store_timings(&self) { let last = self.stats.last_store_report.load(Ordering::Relaxed); let now = solana_sdk::timing::timestamp(); + + #[allow(deprecated)] if now.saturating_sub(last) > 1000 && self .stats diff --git a/runtime/src/bloom.rs b/runtime/src/bloom.rs index 476e5af9b233ca..2fde18a038e97d 100644 --- a/runtime/src/bloom.rs +++ b/runtime/src/bloom.rs @@ -196,14 +196,18 @@ impl AtomicBloom { } } -impl Into> for AtomicBloom { - fn into(self) -> Bloom { - let bits: Vec<_> = self.bits.into_iter().map(AtomicU64::into_inner).collect(); +impl From> for Bloom { + fn from(atomic_bloom: AtomicBloom) -> Self { + let bits: Vec<_> = atomic_bloom + .bits + .into_iter() + .map(AtomicU64::into_inner) + .collect(); let num_bits_set = bits.iter().map(|x| x.count_ones() as u64).sum(); let mut bits: BitVec = bits.into(); - bits.truncate(self.num_bits); + bits.truncate(atomic_bloom.num_bits); Bloom { - keys: self.keys, + keys: atomic_bloom.keys, bits, num_bits_set, _phantom: PhantomData::default(), diff --git a/runtime/src/log_collector.rs b/runtime/src/log_collector.rs index c089bc1c3052eb..382f36afd1c3f8 100644 --- a/runtime/src/log_collector.rs +++ b/runtime/src/log_collector.rs @@ -30,9 +30,9 @@ impl LogCollector { } } -impl Into> for LogCollector { - fn into(self) -> Vec { - self.inner.into_inner().messages +impl From for Vec { + fn from(log_collector: LogCollector) -> Self { + log_collector.inner.into_inner().messages } } diff --git a/runtime/src/native_loader.rs b/runtime/src/native_loader.rs index 983e545e24a5c0..72449a454d18a3 100644 --- a/runtime/src/native_loader.rs +++ b/runtime/src/native_loader.rs @@ -14,7 +14,13 @@ use solana_sdk::{ process_instruction::{InvokeContext, LoaderEntrypoint}, pubkey::Pubkey, }; -use std::{collections::HashMap, env, path::PathBuf, str, sync::RwLock}; +use std::{ + collections::HashMap, + env, + path::{Path, PathBuf}, + str, + sync::RwLock, +}; use thiserror::Error; #[derive(Error, Debug, Serialize, Clone, PartialEq, FromPrimitive, ToPrimitive)] @@ -85,12 +91,12 @@ impl NativeLoader { } #[cfg(windows)] - fn library_open(path: &PathBuf) -> Result { + fn library_open(path: &Path) -> Result { Library::new(path) } #[cfg(not(windows))] - fn library_open(path: &PathBuf) -> Result { + fn library_open(path: &Path) -> Result { // Linux tls bug can cause crash on dlclose(), workaround by never unloading Library::open(Some(path), libc::RTLD_NODELETE | libc::RTLD_NOW) } diff --git a/runtime/src/serde_snapshot/future.rs b/runtime/src/serde_snapshot/future.rs index 837efb8ba3082c..199a870d315f6f 100644 --- a/runtime/src/serde_snapshot/future.rs +++ b/runtime/src/serde_snapshot/future.rs @@ -24,9 +24,9 @@ impl From<&AccountStorageEntry> for SerializableAccountStorageEntry { } } -impl Into for SerializableAccountStorageEntry { - fn into(self) -> AccountStorageEntry { - AccountStorageEntry::new_empty_map(self.id, self.accounts_current_len) +impl From for AccountStorageEntry { + fn from(s: SerializableAccountStorageEntry) -> Self { + AccountStorageEntry::new_empty_map(s.id, s.accounts_current_len) } } @@ -71,43 +71,44 @@ pub(crate) struct DeserializableVersionedBank { pub(crate) message_processor: MessageProcessor, } -impl Into for DeserializableVersionedBank { - fn into(self) -> BankFieldsToDeserialize { +impl From for BankFieldsToDeserialize { + fn from(dvb: DeserializableVersionedBank) -> Self { BankFieldsToDeserialize { - blockhash_queue: self.blockhash_queue, - ancestors: self.ancestors, - hash: self.hash, - parent_hash: self.parent_hash, - parent_slot: self.parent_slot, - hard_forks: self.hard_forks, - transaction_count: self.transaction_count, - tick_height: self.tick_height, - signature_count: self.signature_count, - capitalization: self.capitalization, - max_tick_height: self.max_tick_height, - hashes_per_tick: self.hashes_per_tick, - ticks_per_slot: self.ticks_per_slot, - ns_per_slot: self.ns_per_slot, - genesis_creation_time: self.genesis_creation_time, - slots_per_year: self.slots_per_year, - unused: self.unused, - slot: self.slot, - epoch: self.epoch, - block_height: self.block_height, - collector_id: self.collector_id, - collector_fees: self.collector_fees, - fee_calculator: self.fee_calculator, - fee_rate_governor: self.fee_rate_governor, - collected_rent: self.collected_rent, - rent_collector: self.rent_collector, - epoch_schedule: self.epoch_schedule, - inflation: self.inflation, - stakes: self.stakes, - epoch_stakes: self.epoch_stakes, - is_delta: self.is_delta, + blockhash_queue: dvb.blockhash_queue, + ancestors: dvb.ancestors, + hash: dvb.hash, + parent_hash: dvb.parent_hash, + parent_slot: dvb.parent_slot, + hard_forks: dvb.hard_forks, + transaction_count: dvb.transaction_count, + tick_height: dvb.tick_height, + signature_count: dvb.signature_count, + capitalization: dvb.capitalization, + max_tick_height: dvb.max_tick_height, + hashes_per_tick: dvb.hashes_per_tick, + ticks_per_slot: dvb.ticks_per_slot, + ns_per_slot: dvb.ns_per_slot, + genesis_creation_time: dvb.genesis_creation_time, + slots_per_year: dvb.slots_per_year, + unused: dvb.unused, + slot: dvb.slot, + epoch: dvb.epoch, + block_height: dvb.block_height, + collector_id: dvb.collector_id, + collector_fees: dvb.collector_fees, + fee_calculator: dvb.fee_calculator, + fee_rate_governor: dvb.fee_rate_governor, + collected_rent: dvb.collected_rent, + rent_collector: dvb.rent_collector, + epoch_schedule: dvb.epoch_schedule, + inflation: dvb.inflation, + stakes: dvb.stakes, + epoch_stakes: dvb.epoch_stakes, + is_delta: dvb.is_delta, } } } + // Serializable version of Bank, not Deserializable to avoid cloning by using refs. // Sync fields with DeserializableVersionedBank! #[derive(Serialize)] diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 2c2e7bb0716365..2afc81cc756972 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -585,7 +585,7 @@ pub fn remove_snapshot>(slot: Slot, snapshot_path: P) -> Result<( pub fn bank_from_archive>( account_paths: &[PathBuf], frozen_account_pubkeys: &[Pubkey], - snapshot_path: &PathBuf, + snapshot_path: &Path, snapshot_tar: P, archive_format: ArchiveFormat, genesis_config: &GenesisConfig, @@ -760,7 +760,7 @@ fn rebuild_bank_from_snapshots

( snapshot_version: &str, account_paths: &[PathBuf], frozen_account_pubkeys: &[Pubkey], - unpacked_snapshots_dir: &PathBuf, + unpacked_snapshots_dir: &Path, append_vecs_path: P, genesis_config: &GenesisConfig, debug_keys: Option>>, diff --git a/scripts/coverage.sh b/scripts/coverage.sh index e1e127f6ef24c1..3fd6a13890ef08 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.6.1 ]]; then +if [[ ! "$(grcov --version)" =~ 0.[67].1 ]]; then echo Error: Required grcov version not installed echo "Installed version: $(grcov --version)" diff --git a/sdk/cargo-build-bpf/src/main.rs b/sdk/cargo-build-bpf/src/main.rs index 2b220035bf5109..abee74e221b315 100644 --- a/sdk/cargo-build-bpf/src/main.rs +++ b/sdk/cargo-build-bpf/src/main.rs @@ -70,11 +70,7 @@ where } } -fn build_bpf_package( - config: &Config, - target_directory: &PathBuf, - package: &cargo_metadata::Package, -) { +fn build_bpf_package(config: &Config, target_directory: &Path, package: &cargo_metadata::Package) { let program_name = { let cdylib_targets = package .targets diff --git a/sdk/cargo-test-bpf/src/main.rs b/sdk/cargo-test-bpf/src/main.rs index bc829d4bb4093b..dbd29785eddec2 100644 --- a/sdk/cargo-test-bpf/src/main.rs +++ b/sdk/cargo-test-bpf/src/main.rs @@ -67,11 +67,7 @@ where } } -fn test_bpf_package( - config: &Config, - target_directory: &PathBuf, - package: &cargo_metadata::Package, -) { +fn test_bpf_package(config: &Config, target_directory: &Path, package: &cargo_metadata::Package) { let set_test_bpf_feature = package.features.contains_key("test-bpf"); let bpf_out_dir = config diff --git a/sdk/program/src/program_option.rs b/sdk/program/src/program_option.rs index c2cb65220fc4a4..a0ef3e2ec7236d 100644 --- a/sdk/program/src/program_option.rs +++ b/sdk/program/src/program_option.rs @@ -950,9 +950,9 @@ impl From> for COption { } } -impl Into> for COption { - fn into(self) -> Option { - match self { +impl From> for Option { + fn from(coption: COption) -> Self { + match coption { COption::Some(value) => Some(value), COption::None => None, } diff --git a/sdk/program/src/program_pack.rs b/sdk/program/src/program_pack.rs index d872006fdcd698..cc40595fae45d1 100644 --- a/sdk/program/src/program_pack.rs +++ b/sdk/program/src/program_pack.rs @@ -43,7 +43,7 @@ pub trait Pack: Sealed { if input.len() != Self::LEN { return Err(ProgramError::InvalidAccountData); } - Ok(Self::unpack_from_slice(input)?) + Self::unpack_from_slice(input) } /// Pack into slice diff --git a/sdk/src/signature.rs b/sdk/src/signature.rs index 569ceebda77d4a..6d045f9b658360 100644 --- a/sdk/src/signature.rs +++ b/sdk/src/signature.rs @@ -125,9 +125,9 @@ impl fmt::Display for Signature { } } -impl Into<[u8; 64]> for Signature { - fn into(self) -> [u8; 64] { - as Into<[u8; 64]>>::into(self.0) +impl From for [u8; 64] { + fn from(signature: Signature) -> Self { + signature.0.into() } } diff --git a/storage-bigtable/src/access_token.rs b/storage-bigtable/src/access_token.rs index e74dea211cc5f9..60335b802b675e 100644 --- a/storage-bigtable/src/access_token.rs +++ b/storage-bigtable/src/access_token.rs @@ -89,6 +89,7 @@ impl AccessToken { return; } + #[allow(deprecated)] if self .refresh_active .compare_and_swap(false, true, Ordering::Relaxed) diff --git a/storage-proto/src/convert.rs b/storage-proto/src/convert.rs index 3f68d09382e69e..88dac8853a05d3 100644 --- a/storage-proto/src/convert.rs +++ b/storage-proto/src/convert.rs @@ -768,11 +768,11 @@ impl TryFrom for Vec { type Error = &'static str; fn try_from(collection: tx_by_addr::TransactionByAddr) -> Result { - Ok(collection + collection .tx_by_addrs .into_iter() .map(|tx_by_addr| tx_by_addr.try_into()) - .collect::, Self::Error>>()?) + .collect::, Self::Error>>() } }