From 528a03f32af9f93187d38b1fadde923b55568321 Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Thu, 7 Sep 2023 12:52:57 +0000 Subject: [PATCH] removes outdated matches crate from dependencies (#33172) removes outdated matches crate from the dependencies std::matches has been stable since rust 1.42.0. Other use-cases are covered by assert_matches crate. --- Cargo.lock | 14 ++++++-------- Cargo.toml | 1 - core/Cargo.toml | 2 +- core/src/lib.rs | 2 +- entry/Cargo.toml | 2 +- entry/src/poh.rs | 2 +- gossip/Cargo.toml | 2 +- gossip/src/contact_info.rs | 2 +- gossip/src/crds.rs | 2 +- gossip/src/lib.rs | 2 +- ledger/Cargo.toml | 1 - ledger/src/blockstore_processor.rs | 2 +- ledger/src/shred.rs | 2 +- ledger/src/shred/legacy.rs | 2 +- ledger/src/shred/merkle.rs | 2 +- ledger/src/shredder.rs | 2 +- ledger/src/sigverify_shreds.rs | 2 +- merkle-tree/Cargo.toml | 4 ---- merkle-tree/src/lib.rs | 4 ---- perf/Cargo.toml | 2 +- perf/src/lib.rs | 2 +- poh/Cargo.toml | 2 +- poh/src/lib.rs | 2 +- programs/sbf/Cargo.lock | 3 +-- turbine/Cargo.toml | 2 +- turbine/src/lib.rs | 2 +- 26 files changed, 27 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a6781019d15c7..35e158490e47e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5722,6 +5722,7 @@ dependencies = [ name = "solana-core" version = "1.17.0" dependencies = [ + "assert_matches", "base64 0.21.3", "bincode", "bs58", @@ -5737,7 +5738,6 @@ dependencies = [ "lazy_static", "log", "lru", - "matches", "min-max-heap", "num_enum 0.6.1", "quinn", @@ -5879,12 +5879,12 @@ dependencies = [ name = "solana-entry" version = "1.17.0" dependencies = [ + "assert_matches", "bincode", "crossbeam-channel", "dlopen2", "lazy_static", "log", - "matches", "rand 0.8.5", "rayon", "serde", @@ -6033,6 +6033,7 @@ dependencies = [ name = "solana-gossip" version = "1.17.0" dependencies = [ + "assert_matches", "bincode", "bv", "clap 2.33.3", @@ -6042,7 +6043,6 @@ dependencies = [ "itertools", "log", "lru", - "matches", "num-traits", "num_cpus", "rand 0.8.5", @@ -6151,7 +6151,6 @@ dependencies = [ "libc", "log", "lru", - "matches", "num_cpus", "num_enum 0.6.1", "prost", @@ -6349,7 +6348,6 @@ version = "1.17.0" dependencies = [ "fast-math", "hex", - "matches", "solana-program", ] @@ -6415,6 +6413,7 @@ name = "solana-perf" version = "1.17.0" dependencies = [ "ahash 0.8.3", + "assert_matches", "bincode", "bv", "caps", @@ -6424,7 +6423,6 @@ dependencies = [ "lazy_static", "libc", "log", - "matches", "nix 0.26.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -6442,11 +6440,11 @@ dependencies = [ name = "solana-poh" version = "1.17.0" dependencies = [ + "assert_matches", "bincode", "core_affinity", "crossbeam-channel", "log", - "matches", "rand 0.8.5", "solana-entry", "solana-ledger", @@ -7276,6 +7274,7 @@ dependencies = [ name = "solana-turbine" version = "1.17.0" dependencies = [ + "assert_matches", "bincode", "bytes", "crossbeam-channel", @@ -7283,7 +7282,6 @@ dependencies = [ "itertools", "log", "lru", - "matches", "quinn", "rand 0.8.5", "rand_chacha 0.3.1", diff --git a/Cargo.toml b/Cargo.toml index 1e08f9173f4d11..4a4c95baed54f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -231,7 +231,6 @@ light-poseidon = "0.1.1" log = "0.4.20" lru = "0.7.7" lz4 = "1.24.0" -matches = "0.1.10" memmap2 = "0.5.10" memoffset = "0.9" merlin = "3" diff --git a/core/Cargo.toml b/core/Cargo.toml index a78ad1af40e8c5..555e72a7ffecc6 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -76,8 +76,8 @@ tokio = { workspace = true, features = ["full"] } trees = { workspace = true } [dev-dependencies] +assert_matches = { workspace = true } fs_extra = { workspace = true } -matches = { workspace = true } raptorq = { workspace = true } serde_json = { workspace = true } serial_test = { workspace = true } diff --git a/core/src/lib.rs b/core/src/lib.rs index c1ee7dda1be957..99ac98b5d422cc 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -69,4 +69,4 @@ extern crate solana_frozen_abi_macro; #[cfg(test)] #[macro_use] -extern crate matches; +extern crate assert_matches; diff --git a/entry/Cargo.toml b/entry/Cargo.toml index 73fc1b322ecf24..a9bde85d833e7c 100644 --- a/entry/Cargo.toml +++ b/entry/Cargo.toml @@ -26,7 +26,7 @@ solana-rayon-threadlimit = { workspace = true } solana-sdk = { workspace = true } [dev-dependencies] -matches = { workspace = true } +assert_matches = { workspace = true } solana-logger = { workspace = true } [lib] diff --git a/entry/src/poh.rs b/entry/src/poh.rs index 500ebaae9eb832..31dd1abbb6af1b 100644 --- a/entry/src/poh.rs +++ b/entry/src/poh.rs @@ -128,7 +128,7 @@ pub fn compute_hashes_per_tick(duration: Duration, hashes_sample_size: u64) -> u mod tests { use { crate::poh::{Poh, PohEntry}, - matches::assert_matches, + assert_matches::assert_matches, solana_sdk::hash::{hash, hashv, Hash}, std::time::Duration, }; diff --git a/gossip/Cargo.toml b/gossip/Cargo.toml index c3736c2b8b0883..fcbcf9c9a9f1b4 100644 --- a/gossip/Cargo.toml +++ b/gossip/Cargo.toml @@ -10,6 +10,7 @@ license = { workspace = true } edition = { workspace = true } [dependencies] +assert_matches = { workspace = true } bincode = { workspace = true } bv = { workspace = true, features = ["serde"] } clap = { workspace = true } @@ -19,7 +20,6 @@ indexmap = { workspace = true, features = ["rayon"] } itertools = { workspace = true } log = { workspace = true } lru = { workspace = true } -matches = { workspace = true } num-traits = { workspace = true } rand = { workspace = true } rand_chacha = { workspace = true } diff --git a/gossip/src/contact_info.rs b/gossip/src/contact_info.rs index e3e51f59f5136c..b09957f2ce5db7 100644 --- a/gossip/src/contact_info.rs +++ b/gossip/src/contact_info.rs @@ -1,6 +1,6 @@ use { crate::crds_value::MAX_WALLCLOCK, - matches::{assert_matches, debug_assert_matches}, + assert_matches::{assert_matches, debug_assert_matches}, serde::{Deserialize, Deserializer, Serialize}, solana_sdk::{ pubkey::Pubkey, diff --git a/gossip/src/crds.rs b/gossip/src/crds.rs index a89cc8b3736944..d8ab6e45b3d593 100644 --- a/gossip/src/crds.rs +++ b/gossip/src/crds.rs @@ -32,13 +32,13 @@ use { crds_value::{CrdsData, CrdsValue, CrdsValueLabel}, legacy_contact_info::LegacyContactInfo as ContactInfo, }, + assert_matches::debug_assert_matches, bincode::serialize, indexmap::{ map::{rayon::ParValues, Entry, IndexMap}, set::IndexSet, }, lru::LruCache, - matches::debug_assert_matches, rayon::{prelude::*, ThreadPool}, solana_sdk::{ clock::Slot, diff --git a/gossip/src/lib.rs b/gossip/src/lib.rs index 459d16babcfc95..11b609f3a37f52 100644 --- a/gossip/src/lib.rs +++ b/gossip/src/lib.rs @@ -31,7 +31,7 @@ extern crate log; #[cfg(test)] #[macro_use] -extern crate matches; +extern crate assert_matches; #[macro_use] extern crate serde_derive; diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index e94f936d5156f3..fa77b944d300da 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -75,7 +75,6 @@ features = ["lz4"] [dev-dependencies] bs58 = { workspace = true } -matches = { workspace = true } solana-account-decoder = { workspace = true } solana-logger = { workspace = true } test-case = { workspace = true } diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index c9221377dae34d..9c988f1fcbc4f2 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -1859,7 +1859,7 @@ pub mod tests { create_genesis_config, create_genesis_config_with_leader, GenesisConfigInfo, }, }, - matches::assert_matches, + assert_matches::assert_matches, rand::{thread_rng, Rng}, solana_entry::entry::{create_ticks, next_entry, next_entry_mut}, solana_program_runtime::declare_process_instruction, diff --git a/ledger/src/shred.rs b/ledger/src/shred.rs index 05414ddc297725..5fda160e29b976 100644 --- a/ledger/src/shred.rs +++ b/ledger/src/shred.rs @@ -1031,8 +1031,8 @@ pub fn verify_test_data_shred( mod tests { use { super::*, + assert_matches::assert_matches, bincode::serialized_size, - matches::assert_matches, rand::Rng, rand_chacha::{rand_core::SeedableRng, ChaChaRng}, solana_sdk::{shred_version, signature::Signer, signer::keypair::keypair_from_seed}, diff --git a/ledger/src/shred/legacy.rs b/ledger/src/shred/legacy.rs index 18fe942523e91d..ad2e59fc4dd7e3 100644 --- a/ledger/src/shred/legacy.rs +++ b/ledger/src/shred/legacy.rs @@ -330,7 +330,7 @@ mod test { use { super::*, crate::shred::{shred_code::MAX_CODE_SHREDS_PER_SLOT, ShredType, MAX_DATA_SHREDS_PER_SLOT}, - matches::assert_matches, + assert_matches::assert_matches, }; #[test] diff --git a/ledger/src/shred/merkle.rs b/ledger/src/shred/merkle.rs index 133788c36a3e73..4f1cd22111e07f 100644 --- a/ledger/src/shred/merkle.rs +++ b/ledger/src/shred/merkle.rs @@ -1052,8 +1052,8 @@ mod test { use { super::*, crate::shred::{ShredFlags, ShredId, SignedData}, + assert_matches::assert_matches, itertools::Itertools, - matches::assert_matches, rand::{seq::SliceRandom, CryptoRng, Rng}, rayon::ThreadPoolBuilder, solana_sdk::signature::{Keypair, Signer}, diff --git a/ledger/src/shredder.rs b/ledger/src/shredder.rs index 3a4b17515ced13..1a597c41f984d4 100644 --- a/ledger/src/shredder.rs +++ b/ledger/src/shredder.rs @@ -472,8 +472,8 @@ mod tests { ShredType, MAX_CODE_SHREDS_PER_SLOT, }, }, + assert_matches::assert_matches, bincode::serialized_size, - matches::assert_matches, rand::{seq::SliceRandom, Rng}, solana_sdk::{ hash::{hash, Hash}, diff --git a/ledger/src/sigverify_shreds.rs b/ledger/src/sigverify_shreds.rs index 0d5575ced2e3d6..238ab42f9c93e1 100644 --- a/ledger/src/sigverify_shreds.rs +++ b/ledger/src/sigverify_shreds.rs @@ -465,7 +465,7 @@ mod tests { shred::{ProcessShredsStats, Shred, ShredFlags, LEGACY_SHRED_DATA_CAPACITY}, shredder::{ReedSolomonCache, Shredder}, }, - matches::assert_matches, + assert_matches::assert_matches, rand::{seq::SliceRandom, Rng}, rayon::ThreadPoolBuilder, solana_entry::entry::Entry, diff --git a/merkle-tree/Cargo.toml b/merkle-tree/Cargo.toml index d71dc7fcc4f22b..9b9f566ade7406 100644 --- a/merkle-tree/Cargo.toml +++ b/merkle-tree/Cargo.toml @@ -13,10 +13,6 @@ edition = { workspace = true } fast-math = { workspace = true } solana-program = { workspace = true } -# This can go once the SBF toolchain target Rust 1.42.0+ -[target.bpfel-unknown-unknown.dependencies] -matches = { workspace = true } - [dev-dependencies] hex = { workspace = true } diff --git a/merkle-tree/src/lib.rs b/merkle-tree/src/lib.rs index 8d544444ab3110..606c487dcf84cb 100644 --- a/merkle-tree/src/lib.rs +++ b/merkle-tree/src/lib.rs @@ -1,8 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#[cfg(target_os = "solana")] -#[macro_use] -extern crate matches; - pub mod merkle_tree; pub use merkle_tree::MerkleTree; diff --git a/perf/Cargo.toml b/perf/Cargo.toml index 100c52df510b05..aea478da078c35 100644 --- a/perf/Cargo.toml +++ b/perf/Cargo.toml @@ -35,7 +35,7 @@ nix = { workspace = true } name = "solana_perf" [dev-dependencies] -matches = { workspace = true } +assert_matches = { workspace = true } rand_chacha = { workspace = true } solana-logger = { workspace = true } test-case = { workspace = true } diff --git a/perf/src/lib.rs b/perf/src/lib.rs index 6cffe0afbf5f28..8d277d7ad69778 100644 --- a/perf/src/lib.rs +++ b/perf/src/lib.rs @@ -18,7 +18,7 @@ extern crate log; #[cfg(test)] #[macro_use] -extern crate matches; +extern crate assert_matches; #[macro_use] extern crate solana_metrics; diff --git a/poh/Cargo.toml b/poh/Cargo.toml index e4109dfe7262e3..4df76178d61841 100644 --- a/poh/Cargo.toml +++ b/poh/Cargo.toml @@ -22,8 +22,8 @@ solana-sdk = { workspace = true } thiserror = { workspace = true } [dev-dependencies] +assert_matches = { workspace = true } bincode = { workspace = true } -matches = { workspace = true } rand = { workspace = true } solana-logger = { workspace = true } solana-perf = { workspace = true } diff --git a/poh/src/lib.rs b/poh/src/lib.rs index 80a02148f3fc94..ff60171d7a8d89 100644 --- a/poh/src/lib.rs +++ b/poh/src/lib.rs @@ -8,4 +8,4 @@ extern crate solana_metrics; #[cfg(test)] #[macro_use] -extern crate matches; +extern crate assert_matches; diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 03a54b3056b984..929ef4225464ad 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5012,6 +5012,7 @@ dependencies = [ name = "solana-gossip" version = "1.17.0" dependencies = [ + "assert_matches", "bincode", "bv", "clap 2.33.3", @@ -5021,7 +5022,6 @@ dependencies = [ "itertools", "log", "lru", - "matches", "num-traits", "rand 0.8.5", "rand_chacha 0.3.1", @@ -5151,7 +5151,6 @@ name = "solana-merkle-tree" version = "1.17.0" dependencies = [ "fast-math", - "matches", "solana-program", ] diff --git a/turbine/Cargo.toml b/turbine/Cargo.toml index 1cddfcef4854fb..8562ab6525a069 100644 --- a/turbine/Cargo.toml +++ b/turbine/Cargo.toml @@ -41,7 +41,7 @@ thiserror = { workspace = true } tokio = { workspace = true } [dev-dependencies] -matches = { workspace = true } +assert_matches = { workspace = true } solana-logger = { workspace = true } [[bench]] diff --git a/turbine/src/lib.rs b/turbine/src/lib.rs index 0f7d538542be46..2c7f3c9368f416 100644 --- a/turbine/src/lib.rs +++ b/turbine/src/lib.rs @@ -14,4 +14,4 @@ extern crate solana_metrics; #[cfg(test)] #[macro_use] -extern crate matches; +extern crate assert_matches;