removes erroneous allow(dead_code) annotations from core (#26660)

This commit is contained in:
behzad nouri 2022-07-18 17:15:47 +00:00 committed by GitHub
parent 18e9225a75
commit 2dd8573287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 16 deletions

View File

@ -114,12 +114,11 @@ pub type Stake = u64;
pub type VotedStakes = HashMap<Slot, Stake>;
pub type PubkeyVotes = Vec<(Pubkey, Slot)>;
// lint warning "bank_weight is never read"
#[allow(dead_code)]
pub(crate) struct ComputedBankState {
pub voted_stakes: VotedStakes,
pub total_stake: Stake,
pub bank_weight: u128,
#[allow(dead_code)]
bank_weight: u128,
// Tree of intervals of lockouts of the form [slot, slot + slot.lockout],
// keyed by end of the range
pub lockout_intervals: LockoutIntervals,

View File

@ -14,15 +14,10 @@ use {
crossbeam_channel::{Receiver as CrossbeamReceiver, Sender as CrossbeamSender},
lru::LruCache,
solana_gossip::cluster_info::ClusterInfo,
solana_ledger::{
blockstore::{Blockstore, SlotMeta},
shred::Nonce,
},
solana_ledger::blockstore::{Blockstore, SlotMeta},
solana_measure::measure::Measure,
solana_runtime::{bank_forks::BankForks, contains::Contains},
solana_sdk::{
clock::Slot, epoch_schedule::EpochSchedule, hash::Hash, pubkey::Pubkey, timing::timestamp,
},
solana_sdk::{clock::Slot, epoch_schedule::EpochSchedule, hash::Hash, pubkey::Pubkey},
solana_streamer::sendmmsg::{batch_send, SendPktsError},
std::{
collections::{HashMap, HashSet},
@ -36,6 +31,8 @@ use {
time::{Duration, Instant},
},
};
#[cfg(test)]
use {solana_ledger::shred::Nonce, solana_sdk::timing::timestamp};
pub type DuplicateSlotsResetSender = CrossbeamSender<Vec<(Slot, Hash)>>;
pub type DuplicateSlotsResetReceiver = CrossbeamReceiver<Vec<(Slot, Hash)>>;
@ -570,7 +567,7 @@ impl RepairService {
}
}
#[cfg_attr(not(test), allow(dead_code))]
#[cfg(test)]
fn generate_duplicate_repairs_for_slot(
blockstore: &Blockstore,
slot: Slot,
@ -595,7 +592,7 @@ impl RepairService {
}
}
#[cfg_attr(not(test), allow(dead_code))]
#[cfg(test)]
fn generate_and_send_duplicate_repairs(
duplicate_slot_repair_statuses: &mut HashMap<Slot, DuplicateSlotRepairStatus>,
cluster_slots: &ClusterSlots,
@ -646,7 +643,7 @@ impl RepairService {
})
}
#[cfg_attr(not(test), allow(dead_code))]
#[cfg(test)]
fn serialize_and_send_request(
repair_type: &ShredRepairType,
repair_socket: &UdpSocket,
@ -662,7 +659,7 @@ impl RepairService {
Ok(())
}
#[cfg_attr(not(test), allow(dead_code))]
#[cfg(test)]
fn update_duplicate_slot_repair_addr(
slot: Slot,
status: &mut DuplicateSlotRepairStatus,
@ -684,6 +681,7 @@ impl RepairService {
}
}
#[cfg(test)]
#[allow(dead_code)]
fn initiate_repair_for_duplicate_slot(
slot: Slot,

View File

@ -12,8 +12,7 @@ pub struct UnfrozenGossipVerifiedVoteHashes {
impl UnfrozenGossipVerifiedVoteHashes {
// Update `latest_validator_votes_for_frozen_banks` if gossip has seen a newer vote
// for a frozen bank.
#[allow(dead_code)]
pub fn add_vote(
pub(crate) fn add_vote(
&mut self,
pubkey: Pubkey,
vote_slot: Slot,