From 2534fdb386741a248cc453231a9ee15b86f5b273 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Fri, 17 Nov 2023 12:25:55 +0000 Subject: [PATCH] toolchain: 1.73.0 -> 1.74.0 (#10188) I think discussion is warranted on whether we want to use the lint inheritance. The previous way was definitely quite a bit more terse, but it was also much less composable (e.g. it was less straightforward to exclude or include a specific crate from a specific lint) --- Cargo.toml | 14 ++++++++++- chain/chain-primitives/Cargo.toml | 3 ++- chain/chain/Cargo.toml | 3 +++ chain/chunks-primitives/Cargo.toml | 3 +++ chain/chunks/Cargo.toml | 3 +++ chain/client-primitives/Cargo.toml | 3 +++ chain/client/Cargo.toml | 3 +++ chain/epoch-manager/Cargo.toml | 3 +++ chain/indexer-primitives/Cargo.toml | 3 ++- chain/indexer/Cargo.toml | 3 +++ .../jsonrpc-adversarial-primitives/Cargo.toml | 3 +++ chain/jsonrpc-primitives/Cargo.toml | 3 +++ chain/jsonrpc/Cargo.toml | 3 +++ chain/jsonrpc/client/Cargo.toml | 3 +++ chain/jsonrpc/fuzz/Cargo.toml | 3 +++ chain/jsonrpc/jsonrpc-tests/Cargo.toml | 3 +++ chain/network/Cargo.toml | 3 +++ chain/pool/Cargo.toml | 3 +++ chain/rosetta-rpc/Cargo.toml | 3 +++ chain/telemetry/Cargo.toml | 3 +++ core/async/Cargo.toml | 3 +++ core/chain-configs/Cargo.toml | 3 +++ core/crypto/Cargo.toml | 3 +++ core/dyn-configs/Cargo.toml | 3 +++ core/o11y/Cargo.toml | 3 +++ core/primitives-core/Cargo.toml | 3 +++ core/primitives/Cargo.toml | 3 +++ core/store/Cargo.toml | 3 +++ genesis-tools/genesis-csv-to-json/Cargo.toml | 3 +++ genesis-tools/genesis-populate/Cargo.toml | 3 +++ genesis-tools/keypair-generator/Cargo.toml | 3 +++ integration-tests/Cargo.toml | 3 +++ .../src/tests/client/sync_state_nodes.rs | 3 +++ nearcore/Cargo.toml | 3 +++ neard/Cargo.toml | 3 +++ pytest/tests/loadtest/contract/Cargo.toml | 3 +++ runtime/near-test-contracts/Cargo.toml | 3 +++ runtime/near-vm-runner/Cargo.toml | 3 +++ runtime/near-vm-runner/fuzz/Cargo.toml | 3 +++ .../near-vm/compiler-singlepass/Cargo.toml | 3 +++ .../near-vm/compiler-test-derive/Cargo.toml | 3 +++ runtime/near-vm/compiler/Cargo.toml | 3 +++ runtime/near-vm/engine/Cargo.toml | 3 +++ runtime/near-vm/test-api/Cargo.toml | 3 +++ runtime/near-vm/test-generator/Cargo.toml | 3 +++ runtime/near-vm/types/Cargo.toml | 3 +++ runtime/near-vm/vm/Cargo.toml | 3 +++ runtime/near-vm/wast/Cargo.toml | 3 +++ runtime/runtime-params-estimator/Cargo.toml | 3 +++ .../emu-cost/Dockerfile | 2 +- .../estimator-warehouse/Cargo.toml | 3 +++ runtime/runtime/Cargo.toml | 3 +++ rust-toolchain.toml | 2 +- test-utils/actix-test-utils/Cargo.toml | 3 +++ test-utils/runtime-tester/Cargo.toml | 3 +++ test-utils/runtime-tester/fuzz/Cargo.toml | 3 +++ test-utils/store-validator/Cargo.toml | 3 +++ test-utils/style/Cargo.toml | 3 +++ test-utils/style/src/lib.rs | 12 +-------- test-utils/testlib/Cargo.toml | 3 +++ tools/amend-genesis/Cargo.toml | 3 +++ tools/chainsync-loadtest/Cargo.toml | 3 +++ tools/cold-store/Cargo.toml | 3 +++ tools/database/Cargo.toml | 3 +++ tools/flat-storage/Cargo.toml | 3 +++ tools/fork-network/Cargo.toml | 3 +++ tools/indexer/example/Cargo.toml | 3 +++ tools/mirror/Cargo.toml | 3 +++ tools/mock-node/Cargo.toml | 3 +++ tools/ping/Cargo.toml | 3 +++ tools/restaked/Cargo.toml | 3 +++ tools/rpctypegen/core/Cargo.toml | 3 +++ tools/rpctypegen/macro/Cargo.toml | 3 +++ tools/speedy_sync/Cargo.toml | 3 +++ tools/state-parts-dump-check/Cargo.toml | 3 ++- tools/state-parts/Cargo.toml | 3 +++ tools/state-viewer/Cargo.toml | 3 +++ .../storage-usage-delta-calculator/Cargo.toml | 3 +++ tools/themis/Cargo.toml | 3 +++ tools/themis/src/main.rs | 1 + tools/themis/src/rules.rs | 25 +++++++++++++++++++ tools/undo-block/Cargo.toml | 3 +++ utils/config/Cargo.toml | 3 +++ utils/fmt/Cargo.toml | 3 +++ utils/mainnet-res/Cargo.toml | 3 +++ utils/near-cache/Cargo.toml | 3 +++ .../Cargo.toml | 3 +++ utils/near-performance-metrics/Cargo.toml | 3 +++ utils/near-stable-hasher/Cargo.toml | 3 +++ utils/stdx/Cargo.toml | 3 +++ 90 files changed, 291 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 45e2829995a..58265670f24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ version = "0.0.0" # managed by cargo-workspaces, see below authors = ["Near Inc "] edition = "2021" -rust-version = "1.73.0" +rust-version = "1.74.0" repository = "https://github.com/near/nearcore" license = "MIT OR Apache-2.0" @@ -88,6 +88,18 @@ members = [ "utils/stdx", ] +[workspace.lints.rust] +warnings = "deny" + +[workspace.lints.clippy] +all = { level = "allow", priority = -1 } +clone_on_copy = "deny" +correctness = "deny" +derivable_impls = "deny" +redundant_clone = "deny" +suspicious = "deny" +len_zero = "deny" + [workspace.dependencies] actix = "0.13.0" actix-cors = "0.6.1" diff --git a/chain/chain-primitives/Cargo.toml b/chain/chain-primitives/Cargo.toml index 659bf09b52e..cd86f5811c8 100644 --- a/chain/chain-primitives/Cargo.toml +++ b/chain/chain-primitives/Cargo.toml @@ -9,7 +9,8 @@ repository.workspace = true license.workspace = true publish = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true [dependencies] chrono.workspace = true diff --git a/chain/chain/Cargo.toml b/chain/chain/Cargo.toml index e06c05c9762..6df4b42c01d 100644 --- a/chain/chain/Cargo.toml +++ b/chain/chain/Cargo.toml @@ -5,6 +5,9 @@ authors.workspace = true edition.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true ansi_term.workspace = true diff --git a/chain/chunks-primitives/Cargo.toml b/chain/chunks-primitives/Cargo.toml index 4ece0a9a6f0..8b102524e01 100644 --- a/chain/chunks-primitives/Cargo.toml +++ b/chain/chunks-primitives/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] near-chain-primitives.workspace = true near-primitives.workspace = true diff --git a/chain/chunks/Cargo.toml b/chain/chunks/Cargo.toml index 1a611e79966..c49b903dc81 100644 --- a/chain/chunks/Cargo.toml +++ b/chain/chunks/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true borsh.workspace = true diff --git a/chain/client-primitives/Cargo.toml b/chain/client-primitives/Cargo.toml index 02f0e6b91b2..32984ddc037 100644 --- a/chain/client-primitives/Cargo.toml +++ b/chain/client-primitives/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] actix.workspace = true ansi_term.workspace = true diff --git a/chain/client/Cargo.toml b/chain/client/Cargo.toml index 9ebe33f88d9..9157816b6ed 100644 --- a/chain/client/Cargo.toml +++ b/chain/client/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-rt.workspace = true actix.workspace = true diff --git a/chain/epoch-manager/Cargo.toml b/chain/epoch-manager/Cargo.toml index 670531bc892..9135ff25a36 100644 --- a/chain/epoch-manager/Cargo.toml +++ b/chain/epoch-manager/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] borsh.workspace = true chrono = { workspace = true, optional = true } diff --git a/chain/indexer-primitives/Cargo.toml b/chain/indexer-primitives/Cargo.toml index 75d0c383d3c..2b962a793bb 100644 --- a/chain/indexer-primitives/Cargo.toml +++ b/chain/indexer-primitives/Cargo.toml @@ -9,7 +9,8 @@ repository.workspace = true license.workspace = true publish = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true [dependencies] serde.workspace = true diff --git a/chain/indexer/Cargo.toml b/chain/indexer/Cargo.toml index 1870f1388c6..7f3e9d4b333 100644 --- a/chain/indexer/Cargo.toml +++ b/chain/indexer/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true anyhow.workspace = true diff --git a/chain/jsonrpc-adversarial-primitives/Cargo.toml b/chain/jsonrpc-adversarial-primitives/Cargo.toml index 5d56f6d1fe6..ff5cb74ac79 100644 --- a/chain/jsonrpc-adversarial-primitives/Cargo.toml +++ b/chain/jsonrpc-adversarial-primitives/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] serde.workspace = true diff --git a/chain/jsonrpc-primitives/Cargo.toml b/chain/jsonrpc-primitives/Cargo.toml index b2501364d2e..0f1e5b2e423 100644 --- a/chain/jsonrpc-primitives/Cargo.toml +++ b/chain/jsonrpc-primitives/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] arbitrary.workspace = true serde.workspace = true diff --git a/chain/jsonrpc/Cargo.toml b/chain/jsonrpc/Cargo.toml index e802d10b7e3..15427e71e06 100644 --- a/chain/jsonrpc/Cargo.toml +++ b/chain/jsonrpc/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-cors.workspace = true actix-web.workspace = true diff --git a/chain/jsonrpc/client/Cargo.toml b/chain/jsonrpc/client/Cargo.toml index 4cac0499a5d..eecf28c60f9 100644 --- a/chain/jsonrpc/client/Cargo.toml +++ b/chain/jsonrpc/client/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-http.workspace = true awc.workspace = true diff --git a/chain/jsonrpc/fuzz/Cargo.toml b/chain/jsonrpc/fuzz/Cargo.toml index 15feb6a6b56..3645ef68abf 100644 --- a/chain/jsonrpc/fuzz/Cargo.toml +++ b/chain/jsonrpc/fuzz/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [package.metadata] cargo-fuzz = true diff --git a/chain/jsonrpc/jsonrpc-tests/Cargo.toml b/chain/jsonrpc/jsonrpc-tests/Cargo.toml index c1be52958c4..fad79cb2470 100644 --- a/chain/jsonrpc/jsonrpc-tests/Cargo.toml +++ b/chain/jsonrpc/jsonrpc-tests/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true awc.workspace = true diff --git a/chain/network/Cargo.toml b/chain/network/Cargo.toml index 42800f8756b..a9fd0063e25 100644 --- a/chain/network/Cargo.toml +++ b/chain/network/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [build-dependencies] anyhow.workspace = true protobuf-codegen.workspace = true diff --git a/chain/pool/Cargo.toml b/chain/pool/Cargo.toml index 77f2f52a4e9..117c4650361 100644 --- a/chain/pool/Cargo.toml +++ b/chain/pool/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] borsh.workspace = true once_cell.workspace = true diff --git a/chain/rosetta-rpc/Cargo.toml b/chain/rosetta-rpc/Cargo.toml index 331f06d5ac0..fde635c820b 100644 --- a/chain/rosetta-rpc/Cargo.toml +++ b/chain/rosetta-rpc/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-cors.workspace = true actix-http.workspace = true diff --git a/chain/telemetry/Cargo.toml b/chain/telemetry/Cargo.toml index a86a1730d35..0ce6fc127d1 100644 --- a/chain/telemetry/Cargo.toml +++ b/chain/telemetry/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true awc.workspace = true diff --git a/core/async/Cargo.toml b/core/async/Cargo.toml index e28051a0b82..7734de74d40 100644 --- a/core/async/Cargo.toml +++ b/core/async/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true derive-enum-from-into.workspace = true diff --git a/core/chain-configs/Cargo.toml b/core/chain-configs/Cargo.toml index 1b32dd9c817..b61d88082bc 100644 --- a/core/chain-configs/Cargo.toml +++ b/core/chain-configs/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true bytesize.workspace = true diff --git a/core/crypto/Cargo.toml b/core/crypto/Cargo.toml index ae5ead4ddb9..ebb3dfa349f 100644 --- a/core/crypto/Cargo.toml +++ b/core/crypto/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] blake2.workspace = true borsh.workspace = true diff --git a/core/dyn-configs/Cargo.toml b/core/dyn-configs/Cargo.toml index 597e868e8fc..57c12dc3646 100644 --- a/core/dyn-configs/Cargo.toml +++ b/core/dyn-configs/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true once_cell.workspace = true diff --git a/core/o11y/Cargo.toml b/core/o11y/Cargo.toml index 907b5f2c5a6..585c0de3470 100644 --- a/core/o11y/Cargo.toml +++ b/core/o11y/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] near-crypto.workspace = true near-fmt.workspace = true diff --git a/core/primitives-core/Cargo.toml b/core/primitives-core/Cargo.toml index dc0a9875e57..860774b3ec9 100644 --- a/core/primitives-core/Cargo.toml +++ b/core/primitives-core/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] arbitrary.workspace = true base64.workspace = true diff --git a/core/primitives/Cargo.toml b/core/primitives/Cargo.toml index 8fb4761a712..c56527abde8 100644 --- a/core/primitives/Cargo.toml +++ b/core/primitives/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] arbitrary.workspace = true base64.workspace = true diff --git a/core/store/Cargo.toml b/core/store/Cargo.toml index 6401e51a708..a95e47a3f31 100644 --- a/core/store/Cargo.toml +++ b/core/store/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-rt.workspace = true actix.workspace = true diff --git a/genesis-tools/genesis-csv-to-json/Cargo.toml b/genesis-tools/genesis-csv-to-json/Cargo.toml index 186c6e04bdf..68620e8656e 100644 --- a/genesis-tools/genesis-csv-to-json/Cargo.toml +++ b/genesis-tools/genesis-csv-to-json/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] chrono.workspace = true clap.workspace = true diff --git a/genesis-tools/genesis-populate/Cargo.toml b/genesis-tools/genesis-populate/Cargo.toml index 10903d9145d..e253eec3127 100644 --- a/genesis-tools/genesis-populate/Cargo.toml +++ b/genesis-tools/genesis-populate/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] borsh.workspace = true clap.workspace = true diff --git a/genesis-tools/keypair-generator/Cargo.toml b/genesis-tools/keypair-generator/Cargo.toml index 27f9ab7a109..bdab716f7b8 100644 --- a/genesis-tools/keypair-generator/Cargo.toml +++ b/genesis-tools/keypair-generator/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] clap.workspace = true diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 49ebe01b5a1..7463a1af386 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-rt.workspace = true actix.workspace = true diff --git a/integration-tests/src/tests/client/sync_state_nodes.rs b/integration-tests/src/tests/client/sync_state_nodes.rs index af7aa5a213e..f822efe6331 100644 --- a/integration-tests/src/tests/client/sync_state_nodes.rs +++ b/integration-tests/src/tests/client/sync_state_nodes.rs @@ -413,6 +413,9 @@ fn sync_empty_state() { #[test] #[cfg_attr(not(feature = "expensive_tests"), ignore)] +// FIXME(#9650): locks should not be held across await points, allowed currently only because the +// lint started triggering during a toolchain bump. +#[allow(clippy::await_holding_lock)] /// Runs one node for some time, which dumps state to a temp directory. /// Start the second node which gets state parts from that temp directory. fn sync_state_dump() { diff --git a/nearcore/Cargo.toml b/nearcore/Cargo.toml index 87c5938a6ea..06d0e13d6b2 100644 --- a/nearcore/Cargo.toml +++ b/nearcore/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-rt.workspace = true actix-web.workspace = true diff --git a/neard/Cargo.toml b/neard/Cargo.toml index c9e00bbbab7..a7616a679b1 100644 --- a/neard/Cargo.toml +++ b/neard/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [[bin]] path = "src/main.rs" name = "neard" diff --git a/pytest/tests/loadtest/contract/Cargo.toml b/pytest/tests/loadtest/contract/Cargo.toml index 183bf7a3a38..c0e52d83616 100644 --- a/pytest/tests/loadtest/contract/Cargo.toml +++ b/pytest/tests/loadtest/contract/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" authors = ["Near Inc "] edition = "2018" +[lints] +workspace = true + [workspace] members = [] diff --git a/runtime/near-test-contracts/Cargo.toml b/runtime/near-test-contracts/Cargo.toml index 241ef60627f..c45d5b64fe3 100644 --- a/runtime/near-test-contracts/Cargo.toml +++ b/runtime/near-test-contracts/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] once_cell.workspace = true wat.workspace = true diff --git a/runtime/near-vm-runner/Cargo.toml b/runtime/near-vm-runner/Cargo.toml index 2798b6c68bd..edbe3494290 100644 --- a/runtime/near-vm-runner/Cargo.toml +++ b/runtime/near-vm-runner/Cargo.toml @@ -10,6 +10,9 @@ license.workspace = true categories = ["wasm"] publish = true +[lints] +workspace = true + [dependencies] anyhow = { workspace = true, optional = true } base64.workspace = true diff --git a/runtime/near-vm-runner/fuzz/Cargo.toml b/runtime/near-vm-runner/fuzz/Cargo.toml index 9127527c5dd..e7ce44a5d0d 100644 --- a/runtime/near-vm-runner/fuzz/Cargo.toml +++ b/runtime/near-vm-runner/fuzz/Cargo.toml @@ -11,6 +11,9 @@ publish = false [package.metadata] cargo-fuzz = true +[lints] +workspace = true + [dependencies] arbitrary.workspace = true libfuzzer-sys.workspace = true diff --git a/runtime/near-vm/compiler-singlepass/Cargo.toml b/runtime/near-vm/compiler-singlepass/Cargo.toml index a9e4cbdf10c..17c1a5e5ce1 100644 --- a/runtime/near-vm/compiler-singlepass/Cargo.toml +++ b/runtime/near-vm/compiler-singlepass/Cargo.toml @@ -12,6 +12,9 @@ edition = "2021" publish = true rust-version.workspace = true +[lints] +workspace = true + [dependencies] finite-wasm.workspace = true near-vm-compiler.workspace = true diff --git a/runtime/near-vm/compiler-test-derive/Cargo.toml b/runtime/near-vm/compiler-test-derive/Cargo.toml index e3bcabaadfd..c15ad76628c 100644 --- a/runtime/near-vm/compiler-test-derive/Cargo.toml +++ b/runtime/near-vm/compiler-test-derive/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["unsafe", "body", "fn", "safety", "hygiene"] categories = ["rust-patterns"] publish = false +[lints] +workspace = true + [dependencies] proc-macro2.workspace = true quote.workspace = true diff --git a/runtime/near-vm/compiler/Cargo.toml b/runtime/near-vm/compiler/Cargo.toml index d7d501230b8..3f9d13a4689 100644 --- a/runtime/near-vm/compiler/Cargo.toml +++ b/runtime/near-vm/compiler/Cargo.toml @@ -12,6 +12,9 @@ edition = "2021" publish = true rust-version.workspace = true +[lints] +workspace = true + [dependencies] finite-wasm.workspace = true near-vm-vm.workspace = true diff --git a/runtime/near-vm/engine/Cargo.toml b/runtime/near-vm/engine/Cargo.toml index 3a346cfb1e5..27b727d3fe9 100644 --- a/runtime/near-vm/engine/Cargo.toml +++ b/runtime/near-vm/engine/Cargo.toml @@ -12,6 +12,9 @@ edition = "2021" publish = true rust-version.workspace = true +[lints] +workspace = true + [dependencies] backtrace.workspace = true enumset.workspace = true diff --git a/runtime/near-vm/test-api/Cargo.toml b/runtime/near-vm/test-api/Cargo.toml index e789bba7bb5..00a4b3cb92e 100644 --- a/runtime/near-vm/test-api/Cargo.toml +++ b/runtime/near-vm/test-api/Cargo.toml @@ -12,6 +12,9 @@ edition = "2021" publish = false rust-version.workspace = true +[lints] +workspace = true + # Shared dependencies. [dependencies] # - Mandatory shared dependencies. diff --git a/runtime/near-vm/test-generator/Cargo.toml b/runtime/near-vm/test-generator/Cargo.toml index 805ae8a9936..f03a27c7836 100644 --- a/runtime/near-vm/test-generator/Cargo.toml +++ b/runtime/near-vm/test-generator/Cargo.toml @@ -6,6 +6,9 @@ authors = ["Wasmer Engineering Team ", "Near Inc "] +[lints] +workspace = true + [dependencies] diff --git a/test-utils/style/src/lib.rs b/test-utils/style/src/lib.rs index fc3f93ed774..125f9fa16b0 100644 --- a/test-utils/style/src/lib.rs +++ b/test-utils/style/src/lib.rs @@ -50,17 +50,7 @@ fn clippy() { let cargo = std::env::var_os("CARGO").unwrap_or(OsString::from("cargo")); let mut cmd = Command::new(cargo); cargo_env(&mut cmd); - cmd.args(&["clippy", "--all-targets", "--all-features", "--locked", "--"]); - cmd.args(&[ - "-Aclippy::all", - "-Dwarnings", - "-Dclippy::clone_on_copy", - "-Dclippy::correctness", - "-Dclippy::derivable_impls", - "-Dclippy::redundant_clone", - "-Dclippy::suspicious", - "-Dclippy::len_zero", - ]); + cmd.args(&["clippy", "--all-targets", "--all-features", "--locked"]); ensure_success(cmd); } diff --git a/test-utils/testlib/Cargo.toml b/test-utils/testlib/Cargo.toml index 1ba085379f7..36be0ad0c5d 100644 --- a/test-utils/testlib/Cargo.toml +++ b/test-utils/testlib/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] once_cell.workspace = true diff --git a/tools/amend-genesis/Cargo.toml b/tools/amend-genesis/Cargo.toml index aaddc473d95..70d7b98aaef 100644 --- a/tools/amend-genesis/Cargo.toml +++ b/tools/amend-genesis/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] anyhow.workspace = true borsh.workspace = true diff --git a/tools/chainsync-loadtest/Cargo.toml b/tools/chainsync-loadtest/Cargo.toml index 3971db9766c..ff6351de154 100644 --- a/tools/chainsync-loadtest/Cargo.toml +++ b/tools/chainsync-loadtest/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [[bin]] path = "src/main.rs" name = "chainsync-loadtest" diff --git a/tools/cold-store/Cargo.toml b/tools/cold-store/Cargo.toml index b09689d99f9..c1c35103958 100644 --- a/tools/cold-store/Cargo.toml +++ b/tools/cold-store/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] anyhow.workspace = true borsh.workspace = true diff --git a/tools/database/Cargo.toml b/tools/database/Cargo.toml index 9c9d9fc6fc9..90dcd4b537d 100644 --- a/tools/database/Cargo.toml +++ b/tools/database/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] anyhow.workspace = true borsh.workspace = true diff --git a/tools/flat-storage/Cargo.toml b/tools/flat-storage/Cargo.toml index 9bfeeb82e98..5853aaba4e3 100644 --- a/tools/flat-storage/Cargo.toml +++ b/tools/flat-storage/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] anyhow.workspace = true borsh.workspace = true diff --git a/tools/fork-network/Cargo.toml b/tools/fork-network/Cargo.toml index cbb535d0dae..1f7a3efaea2 100644 --- a/tools/fork-network/Cargo.toml +++ b/tools/fork-network/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true anyhow.workspace = true diff --git a/tools/indexer/example/Cargo.toml b/tools/indexer/example/Cargo.toml index 1baea8d9e20..72e71654b6d 100644 --- a/tools/indexer/example/Cargo.toml +++ b/tools/indexer/example/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true anyhow.workspace = true diff --git a/tools/mirror/Cargo.toml b/tools/mirror/Cargo.toml index e6aaaba5833..71411868d6b 100644 --- a/tools/mirror/Cargo.toml +++ b/tools/mirror/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true anyhow.workspace = true diff --git a/tools/mock-node/Cargo.toml b/tools/mock-node/Cargo.toml index ac7953d32f1..ef4501f6d59 100644 --- a/tools/mock-node/Cargo.toml +++ b/tools/mock-node/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-rt.workspace = true actix.workspace = true diff --git a/tools/ping/Cargo.toml b/tools/ping/Cargo.toml index 2f2d6f146cf..690e933aa82 100644 --- a/tools/ping/Cargo.toml +++ b/tools/ping/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix-web.workspace = true anyhow.workspace = true diff --git a/tools/restaked/Cargo.toml b/tools/restaked/Cargo.toml index d64cef619de..8cc8eb2aee7 100644 --- a/tools/restaked/Cargo.toml +++ b/tools/restaked/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] clap.workspace = true tokio.workspace = true diff --git a/tools/rpctypegen/core/Cargo.toml b/tools/rpctypegen/core/Cargo.toml index a9f260dd889..c9dc8b47539 100644 --- a/tools/rpctypegen/core/Cargo.toml +++ b/tools/rpctypegen/core/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] quote.workspace = true serde.workspace = true diff --git a/tools/rpctypegen/macro/Cargo.toml b/tools/rpctypegen/macro/Cargo.toml index 776d80bf437..8cfd58f2f2d 100644 --- a/tools/rpctypegen/macro/Cargo.toml +++ b/tools/rpctypegen/macro/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [lib] proc-macro = true diff --git a/tools/speedy_sync/Cargo.toml b/tools/speedy_sync/Cargo.toml index bf7b1efb3b7..76d196488cd 100644 --- a/tools/speedy_sync/Cargo.toml +++ b/tools/speedy_sync/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] near-store.workspace = true near-chain-primitives.workspace = true diff --git a/tools/state-parts-dump-check/Cargo.toml b/tools/state-parts-dump-check/Cargo.toml index 6ef455d2255..8c363ed7258 100644 --- a/tools/state-parts-dump-check/Cargo.toml +++ b/tools/state-parts-dump-check/Cargo.toml @@ -8,7 +8,8 @@ repository.workspace = true license.workspace = true publish = false -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true [dependencies] actix-web.workspace = true diff --git a/tools/state-parts/Cargo.toml b/tools/state-parts/Cargo.toml index 92a94007fd2..39e7fd0fc91 100644 --- a/tools/state-parts/Cargo.toml +++ b/tools/state-parts/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] anyhow.workspace = true chrono.workspace = true diff --git a/tools/state-viewer/Cargo.toml b/tools/state-viewer/Cargo.toml index 7c2e03b9e53..9e66d4586a9 100644 --- a/tools/state-viewer/Cargo.toml +++ b/tools/state-viewer/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true ansi_term.workspace = true diff --git a/tools/storage-usage-delta-calculator/Cargo.toml b/tools/storage-usage-delta-calculator/Cargo.toml index aaa033db0f4..a0e8a98490f 100644 --- a/tools/storage-usage-delta-calculator/Cargo.toml +++ b/tools/storage-usage-delta-calculator/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] anyhow.workspace = true serde_json.workspace = true diff --git a/tools/themis/Cargo.toml b/tools/themis/Cargo.toml index 7765058e54a..aa43cdf07ae 100644 --- a/tools/themis/Cargo.toml +++ b/tools/themis/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] toml.workspace = true serde.workspace = true diff --git a/tools/themis/src/main.rs b/tools/themis/src/main.rs index e5d94fc5986..a6ed42f5279 100644 --- a/tools/themis/src/main.rs +++ b/tools/themis/src/main.rs @@ -12,6 +12,7 @@ fn main() -> anyhow::Result<()> { rules::is_unversioned, rules::has_publish_spec, rules::has_rust_version, + rules::has_lint_inheritance, rules::rust_version_matches_toolchain, rules::has_unified_rust_edition, rules::author_is_near, diff --git a/tools/themis/src/rules.rs b/tools/themis/src/rules.rs index 6e20c1c8c6d..e36916e305f 100644 --- a/tools/themis/src/rules.rs +++ b/tools/themis/src/rules.rs @@ -49,6 +49,31 @@ pub fn has_rust_version(workspace: &Workspace) -> anyhow::Result<()> { Ok(()) } +/// Ensure all crates inherit workspace-wide lint definitions +pub fn has_lint_inheritance(workspace: &Workspace) -> anyhow::Result<()> { + let outliers: Vec<_> = workspace + .members + .iter() + .filter(|pkg| match pkg.manifest.read(&["lints", "workspace"]) { + None | Some(&toml::Value::Boolean(false)) => { + pkg.manifest.read(&["workspace"]).is_some() + } + Some(_) => false, + }) + .map(|pkg| Outlier { path: pkg.parsed.manifest_path.clone(), found: None, extra: None }) + .collect(); + + if !outliers.is_empty() { + bail!(ComplianceError { + msg: "These packages should specify `lints.workspace = true`".to_string(), + expected: None, + outliers, + }); + } + + Ok(()) +} + /// Ensure rust-version is the same in Cargo.toml and rust-toolchain.toml pub fn rust_version_matches_toolchain(workspace: &Workspace) -> anyhow::Result<()> { fn get<'a>(mut val: &'a toml::Value, indexes: &[&str]) -> anyhow::Result<&'a toml::Value> { diff --git a/tools/undo-block/Cargo.toml b/tools/undo-block/Cargo.toml index d7519bfc7f9..18707f6f313 100644 --- a/tools/undo-block/Cargo.toml +++ b/tools/undo-block/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] anyhow.workspace = true clap.workspace = true diff --git a/utils/config/Cargo.toml b/utils/config/Cargo.toml index 6fd62fc75e3..f08e15a1356 100644 --- a/utils/config/Cargo.toml +++ b/utils/config/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true json_comments.workspace = true diff --git a/utils/fmt/Cargo.toml b/utils/fmt/Cargo.toml index 6714a07c0ec..1cf0b0c94ee 100644 --- a/utils/fmt/Cargo.toml +++ b/utils/fmt/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] near-primitives-core.workspace = true diff --git a/utils/mainnet-res/Cargo.toml b/utils/mainnet-res/Cargo.toml index 648800eb9e1..6a5d3694b28 100644 --- a/utils/mainnet-res/Cargo.toml +++ b/utils/mainnet-res/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] serde_json.workspace = true diff --git a/utils/near-cache/Cargo.toml b/utils/near-cache/Cargo.toml index 9b36edd403d..f14347753d8 100644 --- a/utils/near-cache/Cargo.toml +++ b/utils/near-cache/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] lru.workspace = true diff --git a/utils/near-performance-metrics-macros/Cargo.toml b/utils/near-performance-metrics-macros/Cargo.toml index 2079f6d4faa..77a622d1046 100644 --- a/utils/near-performance-metrics-macros/Cargo.toml +++ b/utils/near-performance-metrics-macros/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] quote.workspace = true syn.workspace = true diff --git a/utils/near-performance-metrics/Cargo.toml b/utils/near-performance-metrics/Cargo.toml index 140fff972ad..79a0def6707 100644 --- a/utils/near-performance-metrics/Cargo.toml +++ b/utils/near-performance-metrics/Cargo.toml @@ -8,6 +8,9 @@ repository.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] actix.workspace = true bitflags.workspace = true diff --git a/utils/near-stable-hasher/Cargo.toml b/utils/near-stable-hasher/Cargo.toml index 4734081b84d..d9c67aef477 100644 --- a/utils/near-stable-hasher/Cargo.toml +++ b/utils/near-stable-hasher/Cargo.toml @@ -8,3 +8,6 @@ description = "`near-stable-hasher` is a library that is essentially a wrapper a repository.workspace = true license.workspace = true publish = true + +[lints] +workspace = true diff --git a/utils/stdx/Cargo.toml b/utils/stdx/Cargo.toml index 2a94cef2dba..281b90cee41 100644 --- a/utils/stdx/Cargo.toml +++ b/utils/stdx/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true license.workspace = true publish = true +[lints] +workspace = true + [dependencies] # Absolutely must not depend on any crates from nearcore workspace, # and should have as few dependencies as possible otherwise.