Upgrades Rust to 1.72.0 & nightly-2023-08-25 (#32961)
* allow pedantic invalid cast lint * allow lint with false-positive triggered by `test-case` crate * nightly `fmt` correction * adapt to rust layout changes * remove dubious test * Use transmute instead of pointer cast and de/ref when check_aligned is false. * Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects. * bump rust nightly to 2023-08-25 * Upgrades Rust to 1.72.0 --------- Co-authored-by: Trent Nelson <trent@solana.com>
This commit is contained in:
parent
114b5b95dd
commit
9e703f85de
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
#[macro_use]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
clap::{crate_description, crate_name, value_t, values_t_or_exit, App, Arg},
|
||||
log::*,
|
||||
|
|
|
@ -694,6 +694,7 @@ pub mod tests {
|
|||
fn set_data_len_unsafe(&self, new_data_len: u64) {
|
||||
// UNSAFE: cast away & (= const ref) to &mut to force to mutate append-only (=read-only) AppendVec
|
||||
unsafe {
|
||||
#[allow(invalid_reference_casting)]
|
||||
std::ptr::write(
|
||||
std::mem::transmute::<*const u64, *mut u64>(&self.meta.data_len),
|
||||
new_data_len,
|
||||
|
@ -711,6 +712,7 @@ pub mod tests {
|
|||
fn set_executable_as_byte(&self, new_executable_byte: u8) {
|
||||
// UNSAFE: Force to interpret mmap-backed &bool as &u8 to write some crafted value;
|
||||
unsafe {
|
||||
#[allow(invalid_reference_casting)]
|
||||
std::ptr::write(
|
||||
std::mem::transmute::<*const bool, *mut u8>(&self.account_meta.executable),
|
||||
new_executable_byte,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
clap::{crate_description, crate_name, Arg, ArgEnum, Command},
|
||||
crossbeam_channel::{unbounded, Receiver},
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod banks_server;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
clap::{crate_description, crate_name, Arg, Command},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod bench;
|
||||
pub mod bench_tps_client;
|
||||
pub mod cli;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
clap::value_t,
|
||||
log::*,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
serial_test::serial,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
mod bucket;
|
||||
pub mod bucket_api;
|
||||
mod bucket_item;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM solanalabs/rust:1.69.0
|
||||
FROM solanalabs/rust:1.72.0
|
||||
ARG date
|
||||
|
||||
RUN set -x \
|
||||
|
|
|
@ -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.69.0
|
||||
FROM rust:1.72.0
|
||||
|
||||
RUN set -x \
|
||||
&& apt update \
|
||||
|
|
|
@ -29,7 +29,7 @@ fi
|
|||
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
|
||||
nightly_version="$RUST_NIGHTLY_VERSION"
|
||||
else
|
||||
nightly_version=2023-04-19
|
||||
nightly_version=2023-08-25
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ nightly_clippy_allows=(--allow=clippy::redundant_clone)
|
|||
_ scripts/cargo-for-all-lock-files.sh -- "+${rust_nightly}" clippy --workspace --all-targets --features dummy-for-ci-check -- \
|
||||
--deny=warnings \
|
||||
--deny=clippy::default_trait_access \
|
||||
--deny=clippy::integer_arithmetic \
|
||||
--deny=clippy::arithmetic_side_effects \
|
||||
--deny=clippy::manual_let_else \
|
||||
--deny=clippy::used_underscore_binding \
|
||||
"${nightly_clippy_allows[@]}"
|
||||
|
@ -87,7 +87,7 @@ _ scripts/cargo-for-all-lock-files.sh -- "+${rust_nightly}" clippy --workspace -
|
|||
_ scripts/cargo-for-all-lock-files.sh -- clippy --workspace --tests --bins --examples --features dummy-for-ci-check -- \
|
||||
--deny=warnings \
|
||||
--deny=clippy::default_trait_access \
|
||||
--deny=clippy::integer_arithmetic \
|
||||
--deny=clippy::arithmetic_side_effects \
|
||||
--deny=clippy::manual_let_else \
|
||||
--deny=clippy::used_underscore_binding
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
mod cli_output;
|
||||
pub mod cli_version;
|
||||
pub mod display;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
macro_rules! ACCOUNT_STRING {
|
||||
() => {
|
||||
r#", one of:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
solana_cli::{
|
||||
check_balance,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
serde_json::Value,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
solana_cli::cli::{process_command, CliCommand, CliConfig},
|
||||
solana_faucet::faucet::run_local_faucet,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![allow(clippy::redundant_closure)]
|
||||
use {
|
||||
assert_matches::assert_matches,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![allow(clippy::redundant_closure)]
|
||||
use {
|
||||
solana_cli::{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
solana_cli::{
|
||||
check_balance,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod connection_cache;
|
||||
pub mod nonblocking;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
log::*,
|
||||
solana_measure::measure::Measure,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod client_connection;
|
||||
pub mod connection_cache;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![feature(test)]
|
||||
|
||||
use {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![feature(test)]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_core;
|
||||
extern crate test;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![recursion_limit = "2048"]
|
||||
//! The `solana` library implements the Solana high-performance blockchain architecture.
|
||||
//! It includes a full Rust implementation of the architecture (see
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// REMOVE once https://github.com/rust-lang/rust-clippy/issues/11153 is fixed
|
||||
#![allow(clippy::items_after_test_module)]
|
||||
|
||||
use {
|
||||
crate::snapshot_utils::create_tmp_accounts_dir_for_tests,
|
||||
log::*,
|
||||
|
@ -665,7 +668,7 @@ fn test_epoch_accounts_hash_and_warping() {
|
|||
// https://github.com/rust-lang/rust/pull/88582
|
||||
// https://github.com/jhpratt/rust/blob/727a4fc7e3f836938dfeb4a2ab237cfca612222d/library/core/src/num/uint_macros.rs#L1811-L1837
|
||||
const fn next_multiple_of(lhs: u64, rhs: u64) -> u64 {
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
match lhs % rhs {
|
||||
0 => lhs,
|
||||
r => lhs + (rhs - r),
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
//! ```
|
||||
//! time: 4007, tip converged: 10, trunk id: 3830, trunk time: 3827, trunk converged 100, trunk height 348
|
||||
//! ```
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate rand;
|
||||
use {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
// Long-running ledger_cleanup tests
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
crate::snapshot_utils::create_tmp_accounts_dir_for_tests,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod block_cost_limits;
|
||||
pub mod cost_model;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod cli;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
//! solana-dos $COMMON --valid-blockhash --transaction-type account-creation
|
||||
//! ```
|
||||
//!
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
crossbeam_channel::{select, tick, unbounded, Receiver, Sender},
|
||||
itertools::Itertools,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
console::Emoji,
|
||||
indicatif::{ProgressBar, ProgressStyle},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod entry;
|
||||
pub mod poh;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod address_generator;
|
||||
pub mod genesis_accounts;
|
||||
pub mod stakes;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//! A command-line executable for generating the chain's genesis config.
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
base64::{prelude::BASE64_STANDARD, Engine},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod cluster_info;
|
||||
pub mod cluster_info_metrics;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
bincode::serialized_size,
|
||||
log::*,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
bip39::{Mnemonic, MnemonicType, Seed},
|
||||
clap::{crate_description, crate_name, Arg, ArgMatches, Command},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
crate::{args::*, bigtable::*, ledger_path::*, ledger_utils::*, output::*, program::*},
|
||||
chrono::{DateTime, Utc},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![feature(test)]
|
||||
extern crate solana_ledger;
|
||||
extern crate test;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![feature(test)]
|
||||
extern crate test;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod bank_forks_utils;
|
||||
pub mod bigtable_delete;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
solana_entry::entry::Entry,
|
||||
solana_ledger::shred::{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod cluster;
|
||||
pub mod cluster_tests;
|
||||
pub mod integration_tests;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
assert_matches::assert_matches,
|
||||
crossbeam_channel::{unbounded, Receiver},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
extern crate byte_unit;
|
||||
|
||||
use {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod macros;
|
||||
pub mod measure;
|
||||
|
|
|
@ -208,7 +208,7 @@ impl<const ALIGN: usize, T: AsRef<[u8]>> From<T> for AlignedMemory<ALIGN> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {super::*, std::io::Write};
|
||||
|
||||
fn do_test<const ALIGN: usize>() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![deny(clippy::integer_arithmetic)]
|
||||
#![deny(clippy::arithmetic_side_effects)]
|
||||
pub mod aligned_memory;
|
||||
|
||||
/// Returns true if `ptr` is aligned to `align`.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
#[cfg(target_os = "solana")]
|
||||
#[macro_use]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod counter;
|
||||
pub mod datapoint;
|
||||
pub mod metrics;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
clap::{crate_description, crate_name, crate_version, Arg, ArgMatches, Command},
|
||||
rand::{thread_rng, Rng},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//! The `net_utils` module assists with networking
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
crossbeam_channel::unbounded,
|
||||
log::*,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
|
|
@ -64,7 +64,7 @@ impl<const K: usize, T: ?Sized + Hash> Deduper<K, T> {
|
|||
|
||||
// Returns true if the data is duplicate.
|
||||
#[must_use]
|
||||
#[allow(clippy::integer_arithmetic)]
|
||||
#[allow(clippy::arithmetic_side_effects)]
|
||||
pub fn dedup(&self, data: &T) -> bool {
|
||||
let mut out = true;
|
||||
let hashers = self.state.iter().map(RandomState::build_hasher);
|
||||
|
@ -114,7 +114,7 @@ pub fn dedup_packets_and_count_discards<const K: usize>(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::integer_arithmetic)]
|
||||
#[allow(clippy::arithmetic_side_effects)]
|
||||
mod tests {
|
||||
use {
|
||||
super::*,
|
||||
|
|
|
@ -676,7 +676,7 @@ pub fn ed25519_verify(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::integer_arithmetic)]
|
||||
#[allow(clippy::arithmetic_side_effects)]
|
||||
mod tests {
|
||||
use {
|
||||
super::*,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||
use solana_entry::entry::{self, create_ticks, init_poh, EntrySlice, VerifyRecyclers};
|
||||
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod leader_bank_notifier;
|
||||
pub mod poh_recorder;
|
||||
pub mod poh_service;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
||||
#![deny(clippy::integer_arithmetic)]
|
||||
#![deny(clippy::arithmetic_side_effects)]
|
||||
#![deny(clippy::indexing_slicing)]
|
||||
#![recursion_limit = "2048"]
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//! The solana-program-test provides a BanksClient-based test framework SBF programs
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
// Export tokio for test clients
|
||||
pub use tokio;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
use {
|
||||
bincode::deserialize,
|
||||
log::debug,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![deny(clippy::integer_arithmetic)]
|
||||
#![deny(clippy::arithmetic_side_effects)]
|
||||
#![deny(clippy::indexing_slicing)]
|
||||
|
||||
pub mod serialization;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
byteorder::{ByteOrder, LittleEndian},
|
||||
|
|
|
@ -1632,7 +1632,7 @@ fn account_realloc_region<'a>(
|
|||
}
|
||||
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[allow(clippy::integer_arithmetic)]
|
||||
#[allow(clippy::arithmetic_side_effects)]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use {
|
||||
|
|
|
@ -367,11 +367,13 @@ fn translate_type_inner<'a, T>(
|
|||
check_aligned: bool,
|
||||
) -> Result<&'a mut T, Error> {
|
||||
let host_addr = translate(memory_mapping, access_type, vm_addr, size_of::<T>() as u64)?;
|
||||
|
||||
if check_aligned && !address_is_aligned::<T>(host_addr) {
|
||||
return Err(SyscallError::UnalignedPointer.into());
|
||||
if !check_aligned {
|
||||
Ok(unsafe { std::mem::transmute::<u64, &mut T>(host_addr) })
|
||||
} else if !address_is_aligned::<T>(host_addr) {
|
||||
Err(SyscallError::UnalignedPointer.into())
|
||||
} else {
|
||||
Ok(unsafe { &mut *(host_addr as *mut T) })
|
||||
}
|
||||
Ok(unsafe { &mut *(host_addr as *mut T) })
|
||||
}
|
||||
fn translate_type_mut<'a, T>(
|
||||
memory_mapping: &MemoryMapping,
|
||||
|
@ -1879,7 +1881,7 @@ declare_syscall!(
|
|||
);
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::integer_arithmetic)]
|
||||
#[allow(clippy::arithmetic_side_effects)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
#[allow(deprecated)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod config_instruction;
|
||||
pub mod config_processor;
|
||||
pub mod date_instruction;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![feature(test)]
|
||||
#![cfg(feature = "sbf_c")]
|
||||
#![allow(clippy::uninlined_format_args)]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
solana_rbpf::memory_region::MemoryState,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF program tests loop iteration
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{custom_heap_default, custom_panic_default, entrypoint::SUCCESS};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Solana Rust-based SBF program utility functions and types
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF program that test dynamic memory allocation
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF that tests out using a custom heap
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
solana_program::{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Example Rust-based SBF program that supports the deprecated loader
|
||||
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF program that tests duplicate accounts passed via accounts
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF program that moves a lamport from one account to another
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Example Rust-based SBF program that issues a cross-program-invocation
|
||||
|
||||
#![cfg(feature = "program")]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
crate::instructions::*,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF program tests loop iteration
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF program tests loop iteration
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::log::*;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Solana Rust-based SBF program utility functions and types
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{log::sol_log_64, msg};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Example Rust-based SBF program tests loop iteration
|
||||
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Example Rust-based SBF sanity program that prints out the parameters passed to it
|
||||
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Example Rust-based SBF program that queries sibling instructions
|
||||
|
||||
#![cfg(feature = "program")]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use solana_program::{
|
||||
account_info::AccountInfo,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use {
|
||||
solana_program::{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#[deprecated(
|
||||
since = "1.8.0",
|
||||
note = "Please use `solana_sdk::stake::program::id` or `solana_program::stake::program::id` instead"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
pub mod system_instruction;
|
||||
pub mod system_processor;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod nonblocking;
|
||||
pub mod pubsub_client;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod nonblocking;
|
||||
pub mod quic_client;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
#![allow(dead_code)]
|
||||
pub mod ledger;
|
||||
pub mod ledger_error;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
#![allow(clippy::arithmetic_side_effects)]
|
||||
|
||||
pub mod client_error;
|
||||
pub mod config;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue