From cf2f186915c4da4c5de10bd4d8fc8e8b11d6302b Mon Sep 17 00:00:00 2001 From: ksolana <110843012+ksolana@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:56:04 -0800 Subject: [PATCH] Fix violations of elided_named_lifetimes https://github.com/rust-lang/rust/pull/129207 helps name certain elided lifetimes --- gossip/src/cluster_info.rs | 2 +- gossip/src/push_active_set.rs | 4 ++-- ledger/ledger.lock | 0 ledger/src/blockstore.rs | 4 ++-- runtime/src/bank.rs | 2 +- svm/examples/json-rpc/server/src/rpc_process.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 ledger/ledger.lock diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index 9408b0fdcc8760..1ef4a85711894f 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -1021,7 +1021,7 @@ impl ClusterInfo { &'a self, label: &'static str, counter: &'a Counter, - ) -> TimedGuard<'a, RwLockReadGuard> { + ) -> TimedGuard<'a, RwLockReadGuard<'a, Crds>> { TimedGuard::new(self.gossip.crds.read().unwrap(), label, counter) } diff --git a/gossip/src/push_active_set.rs b/gossip/src/push_active_set.rs index 83f84b8a0624ed..ee33e0fa32f6b1 100644 --- a/gossip/src/push_active_set.rs +++ b/gossip/src/push_active_set.rs @@ -34,7 +34,7 @@ impl PushActiveSet { // If true forces gossip push even if the node has pruned the origin. should_force_push: impl FnMut(&Pubkey) -> bool + 'a, stakes: &HashMap, - ) -> impl Iterator + 'a { + ) -> impl Iterator + 'a { let stake = stakes.get(pubkey).min(stakes.get(origin)); self.get_entry(stake) .get_nodes(pubkey, origin, should_force_push) @@ -115,7 +115,7 @@ impl PushActiveSetEntry { origin: &'a Pubkey, // CRDS value owner. // If true forces gossip push even if the node has pruned the origin. mut should_force_push: impl FnMut(&Pubkey) -> bool + 'a, - ) -> impl Iterator + 'a { + ) -> impl Iterator + 'a { let pubkey_eq_origin = pubkey == origin; self.0 .iter() diff --git a/ledger/ledger.lock b/ledger/ledger.lock new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 07d9a6d0cb5404..a3b6588ae680c2 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -541,7 +541,7 @@ impl Blockstore { &'a self, erasure_set: ErasureSetId, erasure_metas: &'a BTreeMap>, - ) -> Result)>> { + ) -> Result)>> { let (slot, fec_set_index) = erasure_set.store_key(); // Check the previous entry from the in memory map to see if it is the consecutive @@ -1534,7 +1534,7 @@ impl Blockstore { slot: Slot, erasure_meta: &ErasureMeta, just_received_shreds: &'a HashMap, - ) -> Option>> { + ) -> Option>> { // Search for the shred which set the initial erasure config, either inserted, // or in the current batch in just_received_shreds. let index = erasure_meta.first_received_coding_shred_index()?; diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index a72b2ec66284d7..3ffc2b1445c7ca 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3499,7 +3499,7 @@ impl Bank { pub fn prepare_unlocked_batch_from_single_tx<'a>( &'a self, transaction: &'a SanitizedTransaction, - ) -> TransactionBatch<'_, '_, SanitizedTransaction> { + ) -> TransactionBatch<'a, 'a, SanitizedTransaction> { let tx_account_lock_limit = self.get_transaction_account_lock_limit(); let lock_result = validate_account_locks(transaction.message().account_keys(), tx_account_lock_limit); diff --git a/svm/examples/json-rpc/server/src/rpc_process.rs b/svm/examples/json-rpc/server/src/rpc_process.rs index c7e90d119154e9..817c9edc3e93ca 100644 --- a/svm/examples/json-rpc/server/src/rpc_process.rs +++ b/svm/examples/json-rpc/server/src/rpc_process.rs @@ -380,7 +380,7 @@ impl JsonRpcRequestProcessor { fn prepare_unlocked_batch_from_single_tx<'a>( &'a self, transaction: &'a SanitizedTransaction, - ) -> TransactionBatch<'_> { + ) -> TransactionBatch<'a> { let tx_account_lock_limit = solana_sdk::transaction::MAX_TX_ACCOUNT_LOCKS; let lock_result = transaction .get_account_locks(tx_account_lock_limit)