From 1d64076acc309785ee3f5988dfad1e8f68d129d2 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Thu, 27 Jun 2024 11:37:28 +0900 Subject: [PATCH] remove all rustversion usage because it is redundant (#1660) * remove all rustversion usage because it is redundant * remove moved usage of rustversion --- Cargo.lock | 4 ---- Cargo.toml | 1 - gossip/Cargo.toml | 1 - gossip/src/cluster_info.rs | 2 +- programs/sbf/Cargo.lock | 5 ----- programs/sbf/Cargo.toml | 1 - programs/sbf/rust/invoke/Cargo.toml | 1 - programs/sbf/rust/invoke/src/lib.rs | 6 +++--- sdk/Cargo.toml | 1 - sdk/macro/Cargo.toml | 1 - sdk/program/Cargo.toml | 1 - sdk/program/src/account_info.rs | 2 +- sdk/program/src/program_option.rs | 1 - 13 files changed, 5 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2de4ccffa28c6..3238a9097d86e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6392,7 +6392,6 @@ dependencies = [ "rand_chacha 0.3.1", "rayon", "rustc_version 0.4.0", - "rustversion", "serde", "serde_bytes", "serde_derive", @@ -6822,7 +6821,6 @@ dependencies = [ "parking_lot 0.12.3", "rand 0.8.5", "rustc_version 0.4.0", - "rustversion", "serde", "serde_bytes", "serde_derive", @@ -7275,7 +7273,6 @@ dependencies = [ "rand 0.7.3", "rand 0.8.5", "rustc_version 0.4.0", - "rustversion", "serde", "serde_bytes", "serde_derive", @@ -7304,7 +7301,6 @@ dependencies = [ "bs58", "proc-macro2", "quote", - "rustversion", "syn 2.0.68", ] diff --git a/Cargo.toml b/Cargo.toml index 3eb086a61b6ac4..34560bd8d75ab5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -300,7 +300,6 @@ rolling-file = "0.2.0" rpassword = "7.3" rustc_version = "0.4" rustls = { version = "0.21.12", default-features = false, features = ["quic"] } -rustversion = "1.0.17" scopeguard = "1.2.0" semver = "1.0.23" seqlock = "0.2.0" diff --git a/gossip/Cargo.toml b/gossip/Cargo.toml index c25ce914469e2d..5dfbb68c98e7a3 100644 --- a/gossip/Cargo.toml +++ b/gossip/Cargo.toml @@ -24,7 +24,6 @@ num-traits = { workspace = true } rand = { workspace = true } rand_chacha = { workspace = true } rayon = { workspace = true } -rustversion = { workspace = true } serde = { workspace = true } serde_bytes = { workspace = true } serde_derive = { workspace = true } diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index ea3d02715d8774..d002e88baa48ff 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -2076,7 +2076,7 @@ impl ClusterInfo { // // allow lint false positive trait bound requirement (`CryptoRng` only // implemented on `&'a mut T` - #[rustversion::attr(since(1.73), allow(clippy::needless_pass_by_ref_mut))] + #[allow(clippy::needless_pass_by_ref_mut)] fn check_pull_request<'a, R>( &'a self, now: Instant, diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 2e0b89ba5817d6..f46afa9db4d112 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5044,7 +5044,6 @@ dependencies = [ "rand_chacha 0.3.1", "rayon", "rustc_version", - "rustversion", "serde", "serde_bytes", "serde_derive", @@ -5307,7 +5306,6 @@ dependencies = [ "parking_lot 0.12.2", "rand 0.8.5", "rustc_version", - "rustversion", "serde", "serde_bytes", "serde_derive", @@ -5823,7 +5821,6 @@ dependencies = [ name = "solana-sbf-rust-invoke" version = "2.1.0" dependencies = [ - "rustversion", "solana-program", "solana-sbf-rust-invoke-dep", "solana-sbf-rust-invoked-dep", @@ -6129,7 +6126,6 @@ dependencies = [ "rand 0.7.3", "rand 0.8.5", "rustc_version", - "rustversion", "serde", "serde_bytes", "serde_derive", @@ -6152,7 +6148,6 @@ dependencies = [ "bs58", "proc-macro2", "quote", - "rustversion", "syn 2.0.58", ] diff --git a/programs/sbf/Cargo.toml b/programs/sbf/Cargo.toml index 9b89c3947f3f46..453542998d9104 100644 --- a/programs/sbf/Cargo.toml +++ b/programs/sbf/Cargo.toml @@ -22,7 +22,6 @@ net2 = "0.2.37" num-derive = "0.4.2" num-traits = "0.2" rand = "0.8" -rustversion = "1.0.14" serde = "1.0.112" # must match the serde_derive version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251 serde_derive = "1.0.112" # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251 serde_json = "1.0.56" diff --git a/programs/sbf/rust/invoke/Cargo.toml b/programs/sbf/rust/invoke/Cargo.toml index cc0490dd866da7..efef9f6f555f03 100644 --- a/programs/sbf/rust/invoke/Cargo.toml +++ b/programs/sbf/rust/invoke/Cargo.toml @@ -9,7 +9,6 @@ license = { workspace = true } edition = { workspace = true } [dependencies] -rustversion = { workspace = true } solana-program = { workspace = true } solana-sbf-rust-invoke-dep = { workspace = true } solana-sbf-rust-invoked-dep = { workspace = true } diff --git a/programs/sbf/rust/invoke/src/lib.rs b/programs/sbf/rust/invoke/src/lib.rs index 1f1eb97abf8281..be29d6760bec25 100644 --- a/programs/sbf/rust/invoke/src/lib.rs +++ b/programs/sbf/rust/invoke/src/lib.rs @@ -1127,7 +1127,7 @@ fn process_instruction<'a>( let account = &accounts[ARGUMENT_INDEX]; let key = *account.key; let key = &key as *const _ as usize; - #[rustversion::attr(since(1.72), allow(invalid_reference_casting))] + #[allow(invalid_reference_casting)] fn overwrite_account_key(account: &AccountInfo, key: *const Pubkey) { unsafe { let ptr = mem::transmute::<_, *mut *const Pubkey>(&account.key); @@ -1178,7 +1178,7 @@ fn process_instruction<'a>( const CALLEE_PROGRAM_INDEX: usize = 2; let account = &accounts[ARGUMENT_INDEX]; let owner = account.owner as *const _ as usize + 1; - #[rustversion::attr(since(1.72), allow(invalid_reference_casting))] + #[allow(invalid_reference_casting)] fn overwrite_account_owner(account: &AccountInfo, owner: *const Pubkey) { unsafe { let ptr = mem::transmute::<_, *mut *const Pubkey>(&account.owner); @@ -1457,7 +1457,7 @@ struct RcBox { value: T, } -#[rustversion::attr(since(1.72), allow(invalid_reference_casting))] +#[allow(invalid_reference_casting)] unsafe fn overwrite_account_data(account: &AccountInfo, data: Rc>) { std::ptr::write_volatile( &account.data as *const _ as usize as *mut Rc>, diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index be8560a88a26b5..c91a83bed71ddb 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -71,7 +71,6 @@ qstring = { workspace = true } qualifier_attr = { workspace = true, optional = true } rand = { workspace = true, optional = true } rand0-7 = { package = "rand", version = "0.7", optional = true } -rustversion = { workspace = true } serde = { workspace = true } serde_bytes = { workspace = true } serde_derive = { workspace = true } diff --git a/sdk/macro/Cargo.toml b/sdk/macro/Cargo.toml index 2462a65068d35c..04b11590829192 100644 --- a/sdk/macro/Cargo.toml +++ b/sdk/macro/Cargo.toml @@ -16,7 +16,6 @@ proc-macro = true bs58 = { workspace = true } proc-macro2 = { workspace = true } quote = { workspace = true } -rustversion = { workspace = true } syn = { workspace = true, features = ["full"] } [package.metadata.docs.rs] diff --git a/sdk/program/Cargo.toml b/sdk/program/Cargo.toml index cbfaf3161a8d8b..56bf8f815907f8 100644 --- a/sdk/program/Cargo.toml +++ b/sdk/program/Cargo.toml @@ -25,7 +25,6 @@ log = { workspace = true } memoffset = { workspace = true } num-derive = { workspace = true } num-traits = { workspace = true, features = ["i128"] } -rustversion = { workspace = true } serde = { workspace = true } serde_bytes = { workspace = true } serde_derive = { workspace = true } diff --git a/sdk/program/src/account_info.rs b/sdk/program/src/account_info.rs index 3db3e9839b6535..8be88349b0fd22 100644 --- a/sdk/program/src/account_info.rs +++ b/sdk/program/src/account_info.rs @@ -182,7 +182,7 @@ impl<'a> AccountInfo<'a> { Ok(()) } - #[rustversion::attr(since(1.72), allow(invalid_reference_casting))] + #[allow(invalid_reference_casting)] pub fn assign(&self, new_owner: &Pubkey) { // Set the non-mut owner field unsafe { diff --git a/sdk/program/src/program_option.rs b/sdk/program/src/program_option.rs index 777eb3d37803db..b1a7c18d8a75a0 100644 --- a/sdk/program/src/program_option.rs +++ b/sdk/program/src/program_option.rs @@ -950,7 +950,6 @@ impl From> for COption { } } -#[rustversion::since(1.49.0)] impl From> for Option { fn from(coption: COption) -> Self { match coption {