Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit d15173a

Browse files
committed
Address latest nightly clippy lints, but globally disable stable_sort_primitive
1 parent a86397a commit d15173a

File tree

13 files changed

+27
-3
lines changed

13 files changed

+27
-3
lines changed

ci/test-checks.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ _ cargo +"$rust_stable" fmt --all -- --check
5353

5454
# -Z... is needed because of clippy bug: https://github.com/rust-lang/rust-clippy/issues/4612
5555
# run nightly clippy for `sdk/` as there's a moderate amount of nightly-only code there
56-
_ cargo +"$rust_nightly" clippy -Zunstable-options --workspace --all-targets -- --deny=warnings
56+
_ cargo +"$rust_nightly" clippy \
57+
-Zunstable-options --workspace --all-targets \
58+
-- --deny=warnings --allow=clippy::stable_sort_primitive
5759

5860
_ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit --ignore RUSTSEC-2020-0002 --ignore RUSTSEC-2020-0008
5961

core/benches/banking_stage.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ fn make_accounts_txs(txes: usize, mint_keypair: &Keypair, hash: Hash) -> Vec<Tra
109109
.collect()
110110
}
111111

112+
#[allow(clippy::same_item_push)]
112113
fn make_programs_txs(txes: usize, hash: Hash) -> Vec<Transaction> {
113114
let progs = 4;
114115
(0..txes)
@@ -294,6 +295,7 @@ fn simulate_process_entries(
294295
process_entries(&bank, &[entry], randomize_txs, None, None).unwrap();
295296
}
296297

298+
#[allow(clippy::same_item_push)]
297299
fn bench_process_entries(randomize_txs: bool, bencher: &mut Bencher) {
298300
// entropy multiplier should be big enough to provide sufficient entropy
299301
// but small enough to not take too much time while executing the test.

core/benches/retransmit_stage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use std::time::Duration;
2727
use test::Bencher;
2828

2929
#[bench]
30+
#[allow(clippy::same_item_push)]
3031
fn bench_retransmitter(bencher: &mut Bencher) {
3132
solana_logger::setup();
3233
let cluster_info = ClusterInfo::new_with_invalid_keypair(Node::new_localhost().info);

core/src/broadcast_stage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ impl BroadcastStage {
203203
/// which will then close FetchStage in the Tpu, and then the rest of the Tpu,
204204
/// completing the cycle.
205205
#[allow(clippy::too_many_arguments)]
206+
#[allow(clippy::same_item_push)]
206207
fn new(
207208
socks: Vec<UdpSocket>,
208209
cluster_info: Arc<ClusterInfo>,

core/src/cluster_info.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,6 +3345,7 @@ mod tests {
33453345
}
33463346

33473347
#[test]
3348+
#[allow(clippy::same_item_push)]
33483349
fn test_push_epoch_slots_large() {
33493350
use rand::Rng;
33503351
let node_keypair = Arc::new(Keypair::new());

core/src/epoch_slots.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ mod tests {
451451
}
452452

453453
#[test]
454+
#[allow(clippy::same_item_push)]
454455
fn test_epoch_slots_fill_uncompressed_random_range() {
455456
use rand::Rng;
456457
for _ in 0..10 {
@@ -469,6 +470,7 @@ mod tests {
469470
}
470471

471472
#[test]
473+
#[allow(clippy::same_item_push)]
472474
fn test_epoch_slots_fill_compressed_random_range() {
473475
use rand::Rng;
474476
for _ in 0..10 {
@@ -489,6 +491,7 @@ mod tests {
489491
}
490492

491493
#[test]
494+
#[allow(clippy::same_item_push)]
492495
fn test_epoch_slots_fill_random_range() {
493496
use rand::Rng;
494497
for _ in 0..10 {

ledger/src/blockstore.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6600,6 +6600,7 @@ pub mod tests {
66006600
}
66016601

66026602
#[test]
6603+
#[allow(clippy::same_item_push)]
66036604
fn test_get_last_hash() {
66046605
let mut entries: Vec<Entry> = vec![];
66056606
let empty_entries_iterator = entries.iter();

ledger/src/entry.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ pub fn next_entry_mut(start: &mut Hash, num_hashes: u64, transactions: Vec<Trans
638638
entry
639639
}
640640

641+
#[allow(clippy::same_item_push)]
641642
pub fn create_ticks(num_ticks: u64, hashes_per_tick: u64, mut hash: Hash) -> Vec<Entry> {
642643
let mut ticks = Vec::with_capacity(num_ticks as usize);
643644
for _ in 0..num_ticks {
@@ -648,6 +649,7 @@ pub fn create_ticks(num_ticks: u64, hashes_per_tick: u64, mut hash: Hash) -> Vec
648649
ticks
649650
}
650651

652+
#[allow(clippy::same_item_push)]
651653
pub fn create_random_ticks(num_ticks: u64, max_hashes_per_tick: u64, mut hash: Hash) -> Vec<Entry> {
652654
let mut ticks = Vec::with_capacity(num_ticks as usize);
653655
for _ in 0..num_ticks {

programs/vote/src/vote_instruction.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ mod tests {
331331
);
332332
}
333333

334+
#[allow(clippy::same_item_push)]
334335
fn process_instruction(instruction: &Instruction) -> Result<(), InstructionError> {
335336
let mut accounts: Vec<_> = instruction
336337
.accounts

runtime/src/bank.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,7 @@ impl Bank {
19661966
}
19671967
}
19681968

1969+
#[allow(clippy::needless_collect)]
19691970
fn distribute_rent_to_validators(
19701971
&self,
19711972
vote_account_hashmap: &HashMap<Pubkey, (u64, Account)>,

0 commit comments

Comments
 (0)