diff --git a/account-decoder/src/lib.rs b/account-decoder/src/lib.rs index cfba601a7aa5a8..9905e15f5323cd 100644 --- a/account-decoder/src/lib.rs +++ b/account-decoder/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #[macro_use] extern crate lazy_static; #[macro_use] diff --git a/accounts-bench/src/main.rs b/accounts-bench/src/main.rs index c7e75bc4c09385..c439a6dd11b519 100644 --- a/accounts-bench/src/main.rs +++ b/accounts-bench/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #[macro_use] extern crate log; diff --git a/accounts-cluster-bench/src/main.rs b/accounts-cluster-bench/src/main.rs index 06e535cdc2f4b1..9e592131a16905 100644 --- a/accounts-cluster-bench/src/main.rs +++ b/accounts-cluster-bench/src/main.rs @@ -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::*, diff --git a/accounts-db/src/append_vec.rs b/accounts-db/src/append_vec.rs index 7c51e48529aafa..765fa97fdc200e 100644 --- a/accounts-db/src/append_vec.rs +++ b/accounts-db/src/append_vec.rs @@ -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, diff --git a/accounts-db/src/lib.rs b/accounts-db/src/lib.rs index 8f62ea8ffa9257..1bf8ecd3d27149 100644 --- a/accounts-db/src/lib.rs +++ b/accounts-db/src/lib.rs @@ -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; diff --git a/banking-bench/src/main.rs b/banking-bench/src/main.rs index e6ac6c4150ff6c..5d402592ad49ec 100644 --- a/banking-bench/src/main.rs +++ b/banking-bench/src/main.rs @@ -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}, diff --git a/banks-server/src/lib.rs b/banks-server/src/lib.rs index e8dc9f5e31243a..2ea4c4460f373c 100644 --- a/banks-server/src/lib.rs +++ b/banks-server/src/lib.rs @@ -1,2 +1,2 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod banks_server; diff --git a/bench-streamer/src/main.rs b/bench-streamer/src/main.rs index 1cf19510499c8a..987df411341672 100644 --- a/bench-streamer/src/main.rs +++ b/bench-streamer/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { clap::{crate_description, crate_name, Arg, Command}, diff --git a/bench-tps/src/lib.rs b/bench-tps/src/lib.rs index 5226b4e56f07d5..7da3979a30d72c 100644 --- a/bench-tps/src/lib.rs +++ b/bench-tps/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod bench; pub mod bench_tps_client; pub mod cli; diff --git a/bench-tps/src/main.rs b/bench-tps/src/main.rs index 756da9ce737886..7969c402f08cbf 100644 --- a/bench-tps/src/main.rs +++ b/bench-tps/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { clap::value_t, log::*, diff --git a/bench-tps/tests/bench_tps.rs b/bench-tps/tests/bench_tps.rs index 9263532c0052ee..6111d550a355ec 100644 --- a/bench-tps/tests/bench_tps.rs +++ b/bench-tps/tests/bench_tps.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { serial_test::serial, diff --git a/bucket_map/src/lib.rs b/bucket_map/src/lib.rs index a61cae4e36817a..97c29547ad2e91 100644 --- a/bucket_map/src/lib.rs +++ b/bucket_map/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] mod bucket; pub mod bucket_api; mod bucket_item; diff --git a/ci/docker-rust-nightly/Dockerfile b/ci/docker-rust-nightly/Dockerfile index 3f2703b5f494f6..fbd0903a075351 100644 --- a/ci/docker-rust-nightly/Dockerfile +++ b/ci/docker-rust-nightly/Dockerfile @@ -1,4 +1,4 @@ -FROM solanalabs/rust:1.69.0 +FROM solanalabs/rust:1.72.0 ARG date RUN set -x \ diff --git a/ci/docker-rust/Dockerfile b/ci/docker-rust/Dockerfile index ab93615468eb83..07fb9e973e0062 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.69.0 +FROM rust:1.72.0 RUN set -x \ && apt update \ diff --git a/ci/rust-version.sh b/ci/rust-version.sh index 2b43b606de03aa..1baaf19fc70d1e 100644 --- a/ci/rust-version.sh +++ b/ci/rust-version.sh @@ -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 diff --git a/ci/test-checks.sh b/ci/test-checks.sh index 15f891b1e28cbe..0f037cb3478ded 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -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 diff --git a/cli-output/src/lib.rs b/cli-output/src/lib.rs index 3e85d825e11a90..5bd3c036f48bf9 100644 --- a/cli-output/src/lib.rs +++ b/cli-output/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] mod cli_output; pub mod cli_version; pub mod display; diff --git a/cli/src/lib.rs b/cli/src/lib.rs index c271990b58b7ce..e55b14a85424ed 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] macro_rules! ACCOUNT_STRING { () => { r#", one of: diff --git a/cli/tests/nonce.rs b/cli/tests/nonce.rs index 3fd93e18576f41..c5a2bcbb26c540 100644 --- a/cli/tests/nonce.rs +++ b/cli/tests/nonce.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { solana_cli::{ check_balance, diff --git a/cli/tests/program.rs b/cli/tests/program.rs index 892c1032554bef..ec28e4600081b9 100644 --- a/cli/tests/program.rs +++ b/cli/tests/program.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { serde_json::Value, diff --git a/cli/tests/request_airdrop.rs b/cli/tests/request_airdrop.rs index daf0a6afd1e5f6..1004507aa03f88 100644 --- a/cli/tests/request_airdrop.rs +++ b/cli/tests/request_airdrop.rs @@ -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, diff --git a/cli/tests/stake.rs b/cli/tests/stake.rs index 6b886c86b354c1..fe1396db6c5f50 100644 --- a/cli/tests/stake.rs +++ b/cli/tests/stake.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![allow(clippy::redundant_closure)] use { assert_matches::assert_matches, diff --git a/cli/tests/transfer.rs b/cli/tests/transfer.rs index 03c731c723c294..7270a2c7e41d2b 100644 --- a/cli/tests/transfer.rs +++ b/cli/tests/transfer.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![allow(clippy::redundant_closure)] use { solana_cli::{ diff --git a/cli/tests/vote.rs b/cli/tests/vote.rs index 1acd66d825fca8..fb83d232a6f557 100644 --- a/cli/tests/vote.rs +++ b/cli/tests/vote.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { solana_cli::{ check_balance, diff --git a/client/src/lib.rs b/client/src/lib.rs index 1148d9f82a3fcc..889b0c4d279c08 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod connection_cache; pub mod nonblocking; diff --git a/client/src/transaction_executor.rs b/client/src/transaction_executor.rs index 1dd9e860cad8b0..c85aa21f8bb555 100644 --- a/client/src/transaction_executor.rs +++ b/client/src/transaction_executor.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { log::*, solana_measure::measure::Measure, diff --git a/connection-cache/src/lib.rs b/connection-cache/src/lib.rs index cc595ff57498d1..80314369a6e3e5 100644 --- a/connection-cache/src/lib.rs +++ b/connection-cache/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod client_connection; pub mod connection_cache; diff --git a/core/benches/banking_stage.rs b/core/benches/banking_stage.rs index c8d9fbb84e6304..0b0e6876c3db15 100644 --- a/core/benches/banking_stage.rs +++ b/core/benches/banking_stage.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![feature(test)] extern crate test; diff --git a/core/benches/consumer.rs b/core/benches/consumer.rs index 78659757daa7d2..928758deb7f55a 100644 --- a/core/benches/consumer.rs +++ b/core/benches/consumer.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![feature(test)] use { diff --git a/core/benches/shredder.rs b/core/benches/shredder.rs index 6216fdbd871046..93093b1920fb5d 100644 --- a/core/benches/shredder.rs +++ b/core/benches/shredder.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![feature(test)] extern crate test; diff --git a/core/benches/sigverify_stage.rs b/core/benches/sigverify_stage.rs index afa355e98191af..70f33020dd3e70 100644 --- a/core/benches/sigverify_stage.rs +++ b/core/benches/sigverify_stage.rs @@ -1,5 +1,5 @@ #![feature(test)] -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] extern crate solana_core; extern crate test; diff --git a/core/src/lib.rs b/core/src/lib.rs index 2560e9b3212a15..c1ee7dda1be957 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -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 diff --git a/core/tests/epoch_accounts_hash.rs b/core/tests/epoch_accounts_hash.rs index 5fdbc225ff446f..1f6eb702769d3e 100755 --- a/core/tests/epoch_accounts_hash.rs +++ b/core/tests/epoch_accounts_hash.rs @@ -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), diff --git a/core/tests/fork-selection.rs b/core/tests/fork-selection.rs index 3f30ab37129953..eead4942bdddeb 100644 --- a/core/tests/fork-selection.rs +++ b/core/tests/fork-selection.rs @@ -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 { diff --git a/core/tests/ledger_cleanup.rs b/core/tests/ledger_cleanup.rs index 0d325bd31bb4f4..1a096c738bf8ff 100644 --- a/core/tests/ledger_cleanup.rs +++ b/core/tests/ledger_cleanup.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] // Long-running ledger_cleanup tests #[cfg(test)] diff --git a/core/tests/snapshots.rs b/core/tests/snapshots.rs index cf9a2300854d12..b61e84a90810c9 100644 --- a/core/tests/snapshots.rs +++ b/core/tests/snapshots.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { crate::snapshot_utils::create_tmp_accounts_dir_for_tests, diff --git a/cost-model/src/lib.rs b/cost-model/src/lib.rs index 9afaf7b8a3f631..2dd7269e11a435 100644 --- a/cost-model/src/lib.rs +++ b/cost-model/src/lib.rs @@ -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; diff --git a/dos/src/lib.rs b/dos/src/lib.rs index 4bce837bd48702..59df873f7cf11a 100644 --- a/dos/src/lib.rs +++ b/dos/src/lib.rs @@ -1,2 +1,2 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod cli; diff --git a/dos/src/main.rs b/dos/src/main.rs index 93e2a871bd65aa..40782bdcd50fe5 100644 --- a/dos/src/main.rs +++ b/dos/src/main.rs @@ -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, diff --git a/download-utils/src/lib.rs b/download-utils/src/lib.rs index 7b4afc6162b312..c42166437cf8ee 100644 --- a/download-utils/src/lib.rs +++ b/download-utils/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { console::Emoji, indicatif::{ProgressBar, ProgressStyle}, diff --git a/entry/src/lib.rs b/entry/src/lib.rs index e081037f5ba7f4..1df354dfb648f9 100644 --- a/entry/src/lib.rs +++ b/entry/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod entry; pub mod poh; diff --git a/genesis/src/lib.rs b/genesis/src/lib.rs index 33a0e90e4cb9d0..5faf788d0f4f8a 100644 --- a/genesis/src/lib.rs +++ b/genesis/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod address_generator; pub mod genesis_accounts; pub mod stakes; diff --git a/genesis/src/main.rs b/genesis/src/main.rs index 5864ae62d98e8b..038c85d4dfdd9a 100644 --- a/genesis/src/main.rs +++ b/genesis/src/main.rs @@ -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}, diff --git a/gossip/src/lib.rs b/gossip/src/lib.rs index 8fd9d5f6dd6fa1..459d16babcfc95 100644 --- a/gossip/src/lib.rs +++ b/gossip/src/lib.rs @@ -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; diff --git a/gossip/tests/crds_gossip.rs b/gossip/tests/crds_gossip.rs index 33dcafd9a954c8..827da50390c305 100644 --- a/gossip/tests/crds_gossip.rs +++ b/gossip/tests/crds_gossip.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { bincode::serialized_size, log::*, diff --git a/gossip/tests/gossip.rs b/gossip/tests/gossip.rs index a1232b916b874a..9240c2b3ef9145 100644 --- a/gossip/tests/gossip.rs +++ b/gossip/tests/gossip.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #[macro_use] extern crate log; diff --git a/install/src/lib.rs b/install/src/lib.rs index 32895b6e6593fd..159317edd2e5a8 100644 --- a/install/src/lib.rs +++ b/install/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #[macro_use] extern crate lazy_static; diff --git a/keygen/src/keygen.rs b/keygen/src/keygen.rs index d7c2e553c14ec3..20e218d88604cf 100644 --- a/keygen/src/keygen.rs +++ b/keygen/src/keygen.rs @@ -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}, diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index d6f061e5916fe7..49ed077fc334f2 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -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}, diff --git a/ledger/benches/blockstore.rs b/ledger/benches/blockstore.rs index 71cc243917d10d..18f92bb60e201b 100644 --- a/ledger/benches/blockstore.rs +++ b/ledger/benches/blockstore.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![feature(test)] extern crate solana_ledger; extern crate test; diff --git a/ledger/benches/protobuf.rs b/ledger/benches/protobuf.rs index 240674ca012f56..8e462a84beb683 100644 --- a/ledger/benches/protobuf.rs +++ b/ledger/benches/protobuf.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![feature(test)] extern crate test; diff --git a/ledger/src/lib.rs b/ledger/src/lib.rs index 470d03cf228e0e..a8f81be486cead 100644 --- a/ledger/src/lib.rs +++ b/ledger/src/lib.rs @@ -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; diff --git a/ledger/tests/shred.rs b/ledger/tests/shred.rs index a5adcebce5563d..78cdb28d0b39ae 100644 --- a/ledger/tests/shred.rs +++ b/ledger/tests/shred.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { solana_entry::entry::Entry, solana_ledger::shred::{ diff --git a/local-cluster/src/lib.rs b/local-cluster/src/lib.rs index 65c6578759c022..6a5b0c7032750e 100644 --- a/local-cluster/src/lib.rs +++ b/local-cluster/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod cluster; pub mod cluster_tests; pub mod integration_tests; diff --git a/local-cluster/tests/local_cluster.rs b/local-cluster/tests/local_cluster.rs index 086e6c8ce5b229..118332ed384049 100644 --- a/local-cluster/tests/local_cluster.rs +++ b/local-cluster/tests/local_cluster.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { assert_matches::assert_matches, crossbeam_channel::{unbounded, Receiver}, diff --git a/log-analyzer/src/main.rs b/log-analyzer/src/main.rs index baac6597fe5a3f..fcedd7c0dc46cf 100644 --- a/log-analyzer/src/main.rs +++ b/log-analyzer/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] extern crate byte_unit; use { diff --git a/measure/src/lib.rs b/measure/src/lib.rs index 8fd0b24444b397..a1c86feb89a43f 100644 --- a/measure/src/lib.rs +++ b/measure/src/lib.rs @@ -1,3 +1,3 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod macros; pub mod measure; diff --git a/memory-management/src/aligned_memory.rs b/memory-management/src/aligned_memory.rs index a811054a0378d1..689daaaed5e6aa 100644 --- a/memory-management/src/aligned_memory.rs +++ b/memory-management/src/aligned_memory.rs @@ -208,7 +208,7 @@ impl> From for AlignedMemory { #[cfg(test)] mod tests { - #![allow(clippy::integer_arithmetic)] + #![allow(clippy::arithmetic_side_effects)] use {super::*, std::io::Write}; fn do_test() { diff --git a/memory-management/src/lib.rs b/memory-management/src/lib.rs index 3a2503bb43b194..95caf247cd5bb0 100644 --- a/memory-management/src/lib.rs +++ b/memory-management/src/lib.rs @@ -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`. diff --git a/merkle-tree/src/lib.rs b/merkle-tree/src/lib.rs index 5c890082a09a0a..8d544444ab3110 100644 --- a/merkle-tree/src/lib.rs +++ b/merkle-tree/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #[cfg(target_os = "solana")] #[macro_use] diff --git a/metrics/src/lib.rs b/metrics/src/lib.rs index 3fb6540da737d6..fab0d2b5639e1d 100644 --- a/metrics/src/lib.rs +++ b/metrics/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod counter; pub mod datapoint; pub mod metrics; diff --git a/net-shaper/src/main.rs b/net-shaper/src/main.rs index 6de02cd79b733a..f431cc557681d1 100644 --- a/net-shaper/src/main.rs +++ b/net-shaper/src/main.rs @@ -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}, diff --git a/net-utils/src/lib.rs b/net-utils/src/lib.rs index 3f3394144af5e9..1ff48173def0da 100644 --- a/net-utils/src/lib.rs +++ b/net-utils/src/lib.rs @@ -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::*, diff --git a/perf/benches/dedup.rs b/perf/benches/dedup.rs index 8570692bcf5e4f..8d2198d319b22f 100644 --- a/perf/benches/dedup.rs +++ b/perf/benches/dedup.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![feature(test)] extern crate test; diff --git a/perf/benches/shrink.rs b/perf/benches/shrink.rs index 08f19157897b20..4459f5f9a6b0c3 100644 --- a/perf/benches/shrink.rs +++ b/perf/benches/shrink.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![feature(test)] extern crate test; diff --git a/perf/src/deduper.rs b/perf/src/deduper.rs index aafcece1de23d1..063ff0492d3319 100644 --- a/perf/src/deduper.rs +++ b/perf/src/deduper.rs @@ -64,7 +64,7 @@ impl Deduper { // 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( } #[cfg(test)] -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] mod tests { use { super::*, diff --git a/perf/src/sigverify.rs b/perf/src/sigverify.rs index ccccd160adbb7d..6078961d42db71 100644 --- a/perf/src/sigverify.rs +++ b/perf/src/sigverify.rs @@ -676,7 +676,7 @@ pub fn ed25519_verify( } #[cfg(test)] -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] mod tests { use { super::*, diff --git a/poh-bench/src/main.rs b/poh-bench/src/main.rs index c07c4b00c633f7..d835bac05a3ff9 100644 --- a/poh-bench/src/main.rs +++ b/poh-bench/src/main.rs @@ -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")))] diff --git a/poh/src/lib.rs b/poh/src/lib.rs index 017d9889c0e901..80a02148f3fc94 100644 --- a/poh/src/lib.rs +++ b/poh/src/lib.rs @@ -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; diff --git a/program-runtime/src/lib.rs b/program-runtime/src/lib.rs index 24aae9ca9833af..d43d9a5b35fafc 100644 --- a/program-runtime/src/lib.rs +++ b/program-runtime/src/lib.rs @@ -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"] diff --git a/program-test/src/lib.rs b/program-test/src/lib.rs index a4a5207a9d66a2..4cc8fc9ba21bf5 100644 --- a/program-test/src/lib.rs +++ b/program-test/src/lib.rs @@ -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; diff --git a/program-test/tests/warp.rs b/program-test/tests/warp.rs index 05e60deef3df2a..94f497a98f4a76 100644 --- a/program-test/tests/warp.rs +++ b/program-test/tests/warp.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { bincode::deserialize, log::debug, diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index 45430a36930a40..69151d41e2b423 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(clippy::integer_arithmetic)] +#![deny(clippy::arithmetic_side_effects)] #![deny(clippy::indexing_slicing)] pub mod serialization; diff --git a/programs/bpf_loader/src/serialization.rs b/programs/bpf_loader/src/serialization.rs index 1650b845a9a24a..628b52d5dd4aa1 100644 --- a/programs/bpf_loader/src/serialization.rs +++ b/programs/bpf_loader/src/serialization.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { byteorder::{ByteOrder, LittleEndian}, diff --git a/programs/bpf_loader/src/syscalls/cpi.rs b/programs/bpf_loader/src/syscalls/cpi.rs index 568be8b6c0f08f..0240ca65b0d54b 100644 --- a/programs/bpf_loader/src/syscalls/cpi.rs +++ b/programs/bpf_loader/src/syscalls/cpi.rs @@ -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 { diff --git a/programs/bpf_loader/src/syscalls/mod.rs b/programs/bpf_loader/src/syscalls/mod.rs index 5f3a420828b67b..2a52bd9aad915a 100644 --- a/programs/bpf_loader/src/syscalls/mod.rs +++ b/programs/bpf_loader/src/syscalls/mod.rs @@ -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::() as u64)?; - - if check_aligned && !address_is_aligned::(host_addr) { - return Err(SyscallError::UnalignedPointer.into()); + if !check_aligned { + Ok(unsafe { std::mem::transmute::(host_addr) }) + } else if !address_is_aligned::(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)] diff --git a/programs/config/src/lib.rs b/programs/config/src/lib.rs index d7ec42a0e6d102..c165b14477b00c 100644 --- a/programs/config/src/lib.rs +++ b/programs/config/src/lib.rs @@ -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; diff --git a/programs/sbf/benches/bpf_loader.rs b/programs/sbf/benches/bpf_loader.rs index 566dbbfbc27a99..f9941776081080 100644 --- a/programs/sbf/benches/bpf_loader.rs +++ b/programs/sbf/benches/bpf_loader.rs @@ -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, diff --git a/programs/sbf/rust/128bit/src/lib.rs b/programs/sbf/rust/128bit/src/lib.rs index de66b350349a61..985e41bbe488e8 100644 --- a/programs/sbf/rust/128bit/src/lib.rs +++ b/programs/sbf/rust/128bit/src/lib.rs @@ -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}; diff --git a/programs/sbf/rust/128bit_dep/src/lib.rs b/programs/sbf/rust/128bit_dep/src/lib.rs index 7ed9f48a0f54d6..c78c13a357358a 100644 --- a/programs/sbf/rust/128bit_dep/src/lib.rs +++ b/programs/sbf/rust/128bit_dep/src/lib.rs @@ -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; diff --git a/programs/sbf/rust/alloc/src/lib.rs b/programs/sbf/rust/alloc/src/lib.rs index 356f9a82f76ac5..2ee3e72f8b5f62 100644 --- a/programs/sbf/rust/alloc/src/lib.rs +++ b/programs/sbf/rust/alloc/src/lib.rs @@ -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; diff --git a/programs/sbf/rust/custom_heap/src/lib.rs b/programs/sbf/rust/custom_heap/src/lib.rs index 9bc4699d9e8c0f..ce96f8db1a4337 100644 --- a/programs/sbf/rust/custom_heap/src/lib.rs +++ b/programs/sbf/rust/custom_heap/src/lib.rs @@ -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::{ diff --git a/programs/sbf/rust/deprecated_loader/src/lib.rs b/programs/sbf/rust/deprecated_loader/src/lib.rs index ddd81fca87ba69..772e0c0f594cd2 100644 --- a/programs/sbf/rust/deprecated_loader/src/lib.rs +++ b/programs/sbf/rust/deprecated_loader/src/lib.rs @@ -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::{ diff --git a/programs/sbf/rust/dup_accounts/src/lib.rs b/programs/sbf/rust/dup_accounts/src/lib.rs index 4c756050b7f614..2dc96fab5a6eab 100644 --- a/programs/sbf/rust/dup_accounts/src/lib.rs +++ b/programs/sbf/rust/dup_accounts/src/lib.rs @@ -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::{ diff --git a/programs/sbf/rust/external_spend/src/lib.rs b/programs/sbf/rust/external_spend/src/lib.rs index d2d4ad7d72ef85..3d94ef2e78c300 100644 --- a/programs/sbf/rust/external_spend/src/lib.rs +++ b/programs/sbf/rust/external_spend/src/lib.rs @@ -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}; diff --git a/programs/sbf/rust/invoked/src/processor.rs b/programs/sbf/rust/invoked/src/processor.rs index 42a427c74db4f0..73bf25cac79bfc 100644 --- a/programs/sbf/rust/invoked/src/processor.rs +++ b/programs/sbf/rust/invoked/src/processor.rs @@ -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::*, diff --git a/programs/sbf/rust/iter/src/lib.rs b/programs/sbf/rust/iter/src/lib.rs index 6fa13ac752d368..2128765e1349de 100644 --- a/programs/sbf/rust/iter/src/lib.rs +++ b/programs/sbf/rust/iter/src/lib.rs @@ -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::{ diff --git a/programs/sbf/rust/many_args/src/helper.rs b/programs/sbf/rust/many_args/src/helper.rs index f5196ab4747bb8..72c89fc060a6b3 100644 --- a/programs/sbf/rust/many_args/src/helper.rs +++ b/programs/sbf/rust/many_args/src/helper.rs @@ -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::*; diff --git a/programs/sbf/rust/many_args_dep/src/lib.rs b/programs/sbf/rust/many_args_dep/src/lib.rs index 60303034778765..263b0e1ce01c65 100644 --- a/programs/sbf/rust/many_args_dep/src/lib.rs +++ b/programs/sbf/rust/many_args_dep/src/lib.rs @@ -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}; diff --git a/programs/sbf/rust/param_passing_dep/src/lib.rs b/programs/sbf/rust/param_passing_dep/src/lib.rs index 3aa9fa8a41e6ed..2a95ce86000f82 100644 --- a/programs/sbf/rust/param_passing_dep/src/lib.rs +++ b/programs/sbf/rust/param_passing_dep/src/lib.rs @@ -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; diff --git a/programs/sbf/rust/sanity/src/lib.rs b/programs/sbf/rust/sanity/src/lib.rs index c3545c48b03aac..0c820eaa95eaea 100644 --- a/programs/sbf/rust/sanity/src/lib.rs +++ b/programs/sbf/rust/sanity/src/lib.rs @@ -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::{ diff --git a/programs/sbf/rust/sibling_inner_instruction/src/lib.rs b/programs/sbf/rust/sibling_inner_instruction/src/lib.rs index 56df749d60bd7b..bac79f67eee5e7 100644 --- a/programs/sbf/rust/sibling_inner_instruction/src/lib.rs +++ b/programs/sbf/rust/sibling_inner_instruction/src/lib.rs @@ -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, diff --git a/programs/sbf/rust/simulation/src/lib.rs b/programs/sbf/rust/simulation/src/lib.rs index 212619c220048b..843a842ec4081d 100644 --- a/programs/sbf/rust/simulation/src/lib.rs +++ b/programs/sbf/rust/simulation/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { solana_program::{ diff --git a/programs/sbf/rust/spoof1_system/src/lib.rs b/programs/sbf/rust/spoof1_system/src/lib.rs index 37ec33f275ae43..fbc65dfd806c41 100644 --- a/programs/sbf/rust/spoof1_system/src/lib.rs +++ b/programs/sbf/rust/spoof1_system/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey}; diff --git a/programs/stake/src/lib.rs b/programs/stake/src/lib.rs index 0f0d2085325378..b6d2ff478432b6 100644 --- a/programs/stake/src/lib.rs +++ b/programs/stake/src/lib.rs @@ -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" diff --git a/programs/system/src/lib.rs b/programs/system/src/lib.rs index c1bfc548047a98..140127c213923a 100644 --- a/programs/system/src/lib.rs +++ b/programs/system/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod system_instruction; pub mod system_processor; diff --git a/pubsub-client/src/lib.rs b/pubsub-client/src/lib.rs index 72beff330f1df5..d572ee53397183 100644 --- a/pubsub-client/src/lib.rs +++ b/pubsub-client/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod nonblocking; pub mod pubsub_client; diff --git a/quic-client/src/lib.rs b/quic-client/src/lib.rs index 5560f018e527c2..0357969d8296d3 100644 --- a/quic-client/src/lib.rs +++ b/quic-client/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod nonblocking; pub mod quic_client; diff --git a/remote-wallet/src/lib.rs b/remote-wallet/src/lib.rs index 125f1266858d50..2400850734b1c1 100644 --- a/remote-wallet/src/lib.rs +++ b/remote-wallet/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #![allow(dead_code)] pub mod ledger; pub mod ledger_error; diff --git a/rpc-client-api/src/lib.rs b/rpc-client-api/src/lib.rs index 9be15cbab4edec..6386a433f719b7 100644 --- a/rpc-client-api/src/lib.rs +++ b/rpc-client-api/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod client_error; pub mod config; diff --git a/rpc-client/src/lib.rs b/rpc-client/src/lib.rs index 43c15d87651079..fddf3e0aab2d8c 100644 --- a/rpc-client/src/lib.rs +++ b/rpc-client/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod http_sender; pub mod mock_sender; diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index d021155e8911b5..2a5065d95d4672 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] mod cluster_tpu_info; pub mod max_slots; pub mod optimistically_confirmed_bank_tracker; diff --git a/runtime/benches/accounts.rs b/runtime/benches/accounts.rs index 8849f57bbc6d0c..fcd784a21e1bc2 100644 --- a/runtime/benches/accounts.rs +++ b/runtime/benches/accounts.rs @@ -1,5 +1,5 @@ #![feature(test)] -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] extern crate test; diff --git a/runtime/benches/bank.rs b/runtime/benches/bank.rs index 0460617c5314c2..fc8dfbd4a4e564 100644 --- a/runtime/benches/bank.rs +++ b/runtime/benches/bank.rs @@ -1,5 +1,5 @@ #![feature(test)] -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] extern crate test; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 7978048c8540a8..fb22c1f96ccb83 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -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; diff --git a/runtime/tests/stake.rs b/runtime/tests/stake.rs index b0d5e1354695d5..c260fead027308 100755 --- a/runtime/tests/stake.rs +++ b/runtime/tests/stake.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { solana_accounts_db::epoch_accounts_hash::EpochAccountsHash, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f2415f8315ca86..743f7cd993d6a8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.69.0" +channel = "1.72.0" diff --git a/sdk/benches/accounts.rs b/sdk/benches/accounts.rs index 2caf0e421ee615..1206f67860da68 100644 --- a/sdk/benches/accounts.rs +++ b/sdk/benches/accounts.rs @@ -1,5 +1,5 @@ #![feature(test)] -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use solana_sdk::{entrypoint::MAX_PERMITTED_DATA_INCREASE, pubkey::Pubkey}; diff --git a/sdk/gen-headers/src/main.rs b/sdk/gen-headers/src/main.rs index d40143bdc74981..a0a90a4355c820 100644 --- a/sdk/gen-headers/src/main.rs +++ b/sdk/gen-headers/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { log::info, diff --git a/sdk/program/src/account_info.rs b/sdk/program/src/account_info.rs index 372370d0e15a0f..3db3e9839b6535 100644 --- a/sdk/program/src/account_info.rs +++ b/sdk/program/src/account_info.rs @@ -182,6 +182,7 @@ impl<'a> AccountInfo<'a> { Ok(()) } + #[rustversion::attr(since(1.72), allow(invalid_reference_casting))] pub fn assign(&self, new_owner: &Pubkey) { // Set the non-mut owner field unsafe { diff --git a/sdk/program/src/borsh0_10.rs b/sdk/program/src/borsh0_10.rs index d4830fa2bfe494..f29640885e14d6 100644 --- a/sdk/program/src/borsh0_10.rs +++ b/sdk/program/src/borsh0_10.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] //! Utilities for the [borsh] serialization format, version 0.10. //! //! [borsh]: https://borsh.io/ diff --git a/sdk/program/src/borsh0_9.rs b/sdk/program/src/borsh0_9.rs index 83f62bc0037d4d..dd9e401db189c9 100644 --- a/sdk/program/src/borsh0_9.rs +++ b/sdk/program/src/borsh0_9.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] //! Utilities for the [borsh] serialization format, version 0.9. //! //! This file is provided for backwards compatibility with types that still use diff --git a/sdk/program/src/entrypoint.rs b/sdk/program/src/entrypoint.rs index 3b70a8b07f674d..a2fba66da2dfe4 100644 --- a/sdk/program/src/entrypoint.rs +++ b/sdk/program/src/entrypoint.rs @@ -234,7 +234,7 @@ pub struct BumpAllocator { /// Integer arithmetic in this global allocator implementation is safe when /// operating on the prescribed `HEAP_START_ADDRESS` and `HEAP_LENGTH`. Any /// other use may overflow and is thus unsupported and at one's own risk. -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] unsafe impl std::alloc::GlobalAlloc for BumpAllocator { #[inline] unsafe fn alloc(&self, layout: Layout) -> *mut u8 { @@ -272,7 +272,7 @@ pub const BPF_ALIGN_OF_U128: usize = 8; /// done at one's own risk. /// /// # Safety -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] #[allow(clippy::type_complexity)] pub unsafe fn deserialize<'a>(input: *mut u8) -> (&'a Pubkey, Vec>, &'a [u8]) { let mut offset: usize = 0; diff --git a/sdk/program/src/entrypoint_deprecated.rs b/sdk/program/src/entrypoint_deprecated.rs index 05df3ccd786a87..7eedbe6596f331 100644 --- a/sdk/program/src/entrypoint_deprecated.rs +++ b/sdk/program/src/entrypoint_deprecated.rs @@ -7,7 +7,7 @@ //! //! [`bpf_loader_deprecated`]: crate::bpf_loader_deprecated -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] extern crate alloc; use { diff --git a/sdk/program/src/fee_calculator.rs b/sdk/program/src/fee_calculator.rs index 2628466f713b1b..ef29ec2e2beb7d 100644 --- a/sdk/program/src/fee_calculator.rs +++ b/sdk/program/src/fee_calculator.rs @@ -1,6 +1,6 @@ //! Calculation of transaction fees. -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { crate::{clock::DEFAULT_MS_PER_SLOT, ed25519_program, message::Message, secp256k1_program}, log::*, diff --git a/sdk/program/src/instruction.rs b/sdk/program/src/instruction.rs index 404fa54ed34cf3..0aef0008667a5e 100644 --- a/sdk/program/src/instruction.rs +++ b/sdk/program/src/instruction.rs @@ -11,7 +11,7 @@ //! [`AccountMeta`] values. The runtime uses this information to efficiently //! schedule execution of transactions. -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { crate::{pubkey::Pubkey, sanitize::Sanitize, short_vec, wasm_bindgen}, @@ -744,42 +744,3 @@ pub fn get_stack_height() -> usize { crate::program_stubs::sol_get_stack_height() as usize } } - -#[test] -fn test_account_meta_layout() { - #[derive(Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize)] - struct AccountMetaRust { - pub pubkey: Pubkey, - pub is_signer: bool, - pub is_writable: bool, - } - - let account_meta_rust = AccountMetaRust::default(); - let base_rust_addr = &account_meta_rust as *const _ as u64; - let pubkey_rust_addr = &account_meta_rust.pubkey as *const _ as u64; - let is_signer_rust_addr = &account_meta_rust.is_signer as *const _ as u64; - let is_writable_rust_addr = &account_meta_rust.is_writable as *const _ as u64; - - let account_meta_c = AccountMeta::default(); - let base_c_addr = &account_meta_c as *const _ as u64; - let pubkey_c_addr = &account_meta_c.pubkey as *const _ as u64; - let is_signer_c_addr = &account_meta_c.is_signer as *const _ as u64; - let is_writable_c_addr = &account_meta_c.is_writable as *const _ as u64; - - assert_eq!( - std::mem::size_of::(), - std::mem::size_of::() - ); - assert_eq!( - pubkey_rust_addr - base_rust_addr, - pubkey_c_addr - base_c_addr - ); - assert_eq!( - is_signer_rust_addr - base_rust_addr, - is_signer_c_addr - base_c_addr - ); - assert_eq!( - is_writable_rust_addr - base_rust_addr, - is_writable_c_addr - base_c_addr - ); -} diff --git a/sdk/program/src/lib.rs b/sdk/program/src/lib.rs index 21312fb7f3b70b..76d86e1bc86fe1 100644 --- a/sdk/program/src/lib.rs +++ b/sdk/program/src/lib.rs @@ -743,7 +743,7 @@ macro_rules! unchecked_div_by_const { // ugly error messages! // https://users.rust-lang.org/t/unexpected-behavior-of-compile-time-integer-div-by-zero-check-in-declarative-macro/56718 let _ = [(); ($den as usize) - 1]; - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] let quotient = $num / $den; quotient }}; diff --git a/sdk/program/src/message/legacy.rs b/sdk/program/src/message/legacy.rs index e078c1d0f0a073..e81c7c485ff5f6 100644 --- a/sdk/program/src/message/legacy.rs +++ b/sdk/program/src/message/legacy.rs @@ -9,7 +9,7 @@ //! [`v0`]: crate::message::v0 //! [future message format]: https://docs.solana.com/proposals/versioned-transactions -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { crate::{ @@ -597,7 +597,7 @@ impl Message { // `bench_has_duplicates` in benches/message_processor.rs shows that this implementation is // ~50 times faster than using HashSet for very short slices. for i in 1..self.account_keys.len() { - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] if self.account_keys[i..].contains(&self.account_keys[i - 1]) { return true; } diff --git a/sdk/program/src/native_token.rs b/sdk/program/src/native_token.rs index c3731582ab0822..ac494bc8317419 100644 --- a/sdk/program/src/native_token.rs +++ b/sdk/program/src/native_token.rs @@ -1,6 +1,6 @@ //! Definitions for the native SOL token and its fractional lamports. -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] /// There are 10^9 lamports in one SOL pub const LAMPORTS_PER_SOL: u64 = 1_000_000_000; diff --git a/sdk/program/src/program.rs b/sdk/program/src/program.rs index a41f7b52678817..ac7ffb05f3c5ea 100644 --- a/sdk/program/src/program.rs +++ b/sdk/program/src/program.rs @@ -392,7 +392,7 @@ pub fn get_return_data() -> Option<(Pubkey, Vec)> { /// Do sanity checks of type layout. #[doc(hidden)] -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] pub fn check_type_assumptions() { extern crate memoffset; use { diff --git a/sdk/program/src/program_error.rs b/sdk/program/src/program_error.rs index 8644b6ad78dd5e..a0d217a96b84f4 100644 --- a/sdk/program/src/program_error.rs +++ b/sdk/program/src/program_error.rs @@ -1,6 +1,6 @@ //! The [`ProgramError`] type and related definitions. -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { crate::{decode_error::DecodeError, instruction::InstructionError, msg, pubkey::PubkeyError}, borsh::maybestd::io::Error as BorshIoError, diff --git a/sdk/program/src/program_stubs.rs b/sdk/program/src/program_stubs.rs index fb6861b74c5500..24f4dc57d3d77b 100644 --- a/sdk/program/src/program_stubs.rs +++ b/sdk/program/src/program_stubs.rs @@ -22,7 +22,7 @@ pub fn set_syscall_stubs(syscall_stubs: Box) -> Box::BITS { let Some(byte) = seq.next_element::()? else { - return Err(A::Error::custom("Invalid Sequence")); - }; + return Err(A::Error::custom("Invalid Sequence")); + }; out |= ((byte & 0x7F) as Self) << shift; if byte & 0x80 == 0 { // Last byte should not have been truncated when it was diff --git a/sdk/program/src/serialize_utils.rs b/sdk/program/src/serialize_utils.rs index a2b61f75d06de9..d57095ce7a98ea 100644 --- a/sdk/program/src/serialize_utils.rs +++ b/sdk/program/src/serialize_utils.rs @@ -1,6 +1,6 @@ //! Helpers for reading and writing bytes. -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use crate::{pubkey::Pubkey, sanitize::SanitizeError}; pub fn append_u16(buf: &mut Vec, data: u16) { diff --git a/sdk/program/src/short_vec.rs b/sdk/program/src/short_vec.rs index cbf37219143801..b6674ee57e17f2 100644 --- a/sdk/program/src/short_vec.rs +++ b/sdk/program/src/short_vec.rs @@ -1,6 +1,6 @@ //! Compact serde-encoding of vectors with small length. -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { serde::{ de::{self, Deserializer, SeqAccess, Visitor}, diff --git a/sdk/program/src/slot_history.rs b/sdk/program/src/slot_history.rs index 7e62b0798bbbce..725916da2604db 100644 --- a/sdk/program/src/slot_history.rs +++ b/sdk/program/src/slot_history.rs @@ -6,7 +6,7 @@ //! //! [`sysvar::slot_history`]: crate::sysvar::slot_history -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub use crate::clock::Slot; use bv::{BitVec, BitsMut}; diff --git a/sdk/program/src/stake/state.rs b/sdk/program/src/stake/state.rs index b8f2e3be0140f4..969e5f2ceffd29 100644 --- a/sdk/program/src/stake/state.rs +++ b/sdk/program/src/stake/state.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] // Remove the following `allow` when `StakeState` is removed, required to avoid // warnings from uses of deprecated types during trait derivations. #![allow(deprecated)] diff --git a/sdk/program/src/sysvar/instructions.rs b/sdk/program/src/sysvar/instructions.rs index ede54465cc0d4d..ce4283d0c35ae7 100644 --- a/sdk/program/src/sysvar/instructions.rs +++ b/sdk/program/src/sysvar/instructions.rs @@ -27,7 +27,7 @@ //! //! [`secp256k1_instruction`]: https://docs.rs/solana-sdk/latest/solana_sdk/secp256k1_instruction/index.html -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use crate::{ account_info::AccountInfo, diff --git a/sdk/program/src/sysvar/recent_blockhashes.rs b/sdk/program/src/sysvar/recent_blockhashes.rs index a9b02946a51e2a..91be1b8276633a 100644 --- a/sdk/program/src/sysvar/recent_blockhashes.rs +++ b/sdk/program/src/sysvar/recent_blockhashes.rs @@ -17,7 +17,7 @@ //! [sdoc]: https://docs.solana.com/developing/runtime-facilities/sysvars#recentblockhashes #![allow(deprecated)] -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { crate::{ declare_deprecated_sysvar_id, fee_calculator::FeeCalculator, hash::Hash, sysvar::Sysvar, diff --git a/sdk/program/src/vote/state/vote_state_0_23_5.rs b/sdk/program/src/vote/state/vote_state_0_23_5.rs index 7ba4e361eee415..ae3b9207fe494e 100644 --- a/sdk/program/src/vote/state/vote_state_0_23_5.rs +++ b/sdk/program/src/vote/state/vote_state_0_23_5.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use super::*; const MAX_ITEMS: usize = 32; diff --git a/sdk/src/offchain_message.rs b/sdk/src/offchain_message.rs index d6888ca19873d3..2170aedb2c1389 100644 --- a/sdk/src/offchain_message.rs +++ b/sdk/src/offchain_message.rs @@ -42,7 +42,7 @@ pub enum MessageFormat { ExtendedUtf8, } -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] pub mod v0 { use { super::{is_printable_ascii, is_utf8, MessageFormat, OffchainMessage as Base}, diff --git a/sdk/src/shred_version.rs b/sdk/src/shred_version.rs index 6017202c9d6a00..a113a2af1306e0 100644 --- a/sdk/src/shred_version.rs +++ b/sdk/src/shred_version.rs @@ -20,7 +20,7 @@ pub fn version_from_hash(hash: &Hash) -> u16 { }); // convert accum into a u16 // Because accum[0] is a u8, 8bit left shift of the u16 can never overflow - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] let version = ((accum[0] as u16) << 8) | accum[1] as u16; // ensure version is never zero, to avoid looking like an uninitialized version diff --git a/sdk/src/transaction/sanitized.rs b/sdk/src/transaction/sanitized.rs index f73c66a9ed5060..117ae0a8e00148 100644 --- a/sdk/src/transaction/sanitized.rs +++ b/sdk/src/transaction/sanitized.rs @@ -298,7 +298,7 @@ impl SanitizedTransaction { } #[cfg(test)] -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] mod tests { use { super::*, diff --git a/send-transaction-service/src/lib.rs b/send-transaction-service/src/lib.rs index 48820025bbcb4e..fe2bc0c7af5b7f 100644 --- a/send-transaction-service/src/lib.rs +++ b/send-transaction-service/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod send_transaction_service; pub mod tpu_info; diff --git a/stake-accounts/src/main.rs b/stake-accounts/src/main.rs index d9f9ebc238cae2..c931e7423b9b07 100644 --- a/stake-accounts/src/main.rs +++ b/stake-accounts/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] mod arg_parser; mod args; mod stake_accounts; diff --git a/storage-bigtable/src/lib.rs b/storage-bigtable/src/lib.rs index aa891fe0cd282c..0b8ed4d3a593c3 100644 --- a/storage-bigtable/src/lib.rs +++ b/storage-bigtable/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { crate::bigtable::RowKey, diff --git a/streamer/src/lib.rs b/streamer/src/lib.rs index 2dfee737cd6117..225515646e8e0d 100644 --- a/streamer/src/lib.rs +++ b/streamer/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod nonblocking; pub mod packet; pub mod quic; diff --git a/test-validator/src/lib.rs b/test-validator/src/lib.rs index f657aaee1ca00e..5737f71a6aa0de 100644 --- a/test-validator/src/lib.rs +++ b/test-validator/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { base64::{prelude::BASE64_STANDARD, Engine}, crossbeam_channel::Receiver, diff --git a/thin-client/src/lib.rs b/thin-client/src/lib.rs index afb3489f2a4a0d..b685f45ce36638 100644 --- a/thin-client/src/lib.rs +++ b/thin-client/src/lib.rs @@ -1,3 +1,3 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod thin_client; diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 8df0d4f482e4d5..0198312abef524 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod arg_parser; pub mod args; pub mod commands; diff --git a/tpu-client/src/lib.rs b/tpu-client/src/lib.rs index 199a09091e151a..54adaec935a213 100644 --- a/tpu-client/src/lib.rs +++ b/tpu-client/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod nonblocking; pub mod tpu_client; diff --git a/transaction-dos/src/main.rs b/transaction-dos/src/main.rs index 0add74885becbf..5d69e9e291b6b5 100644 --- a/transaction-dos/src/main.rs +++ b/transaction-dos/src/main.rs @@ -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}, diff --git a/transaction-status/src/lib.rs b/transaction-status/src/lib.rs index bb1ddd42d00155..84654a564c4c33 100644 --- a/transaction-status/src/lib.rs +++ b/transaction-status/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub use {crate::extract_memos::extract_and_fmt_memos, solana_sdk::reward_type::RewardType}; use { diff --git a/turbine/src/lib.rs b/turbine/src/lib.rs index d73713549def74..0f7d538542be46 100644 --- a/turbine/src/lib.rs +++ b/turbine/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod broadcast_stage; pub mod cluster_nodes; diff --git a/udp-client/src/lib.rs b/udp-client/src/lib.rs index 75ba9139d3ab06..c4ed99b3b7f82b 100644 --- a/udp-client/src/lib.rs +++ b/udp-client/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub mod nonblocking; pub mod udp_client; diff --git a/validator/src/lib.rs b/validator/src/lib.rs index 4bf5a381d19386..4e7ed43ec78309 100644 --- a/validator/src/lib.rs +++ b/validator/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] pub use solana_test_validator as test_validator; use { console::style, diff --git a/validator/src/main.rs b/validator/src/main.rs index f27d4fcc6537cb..91a31d6d64b36d 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] #[cfg(not(target_env = "msvc"))] use jemallocator::Jemalloc; use { diff --git a/watchtower/src/main.rs b/watchtower/src/main.rs index 8801853d0edb2d..f42acdaadaabc6 100644 --- a/watchtower/src/main.rs +++ b/watchtower/src/main.rs @@ -1,5 +1,5 @@ //! A command-line executable for monitoring the health of a cluster -#![allow(clippy::integer_arithmetic)] +#![allow(clippy::arithmetic_side_effects)] use { clap::{crate_description, crate_name, value_t, value_t_or_exit, App, Arg}, diff --git a/zk-token-sdk/src/lib.rs b/zk-token-sdk/src/lib.rs index 9f4e9b7a5dcbac..f66850e382275c 100644 --- a/zk-token-sdk/src/lib.rs +++ b/zk-token-sdk/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(clippy::integer_arithmetic, clippy::op_ref)] +#![allow(clippy::arithmetic_side_effects, clippy::op_ref)] // The warning `clippy::op_ref` is disabled to allow efficient operator arithmetic of structs that // implement the `Copy` trait.