Skip to content

Commit

Permalink
remove all rustversion usage because it is redundant (#1660)
Browse files Browse the repository at this point in the history
* remove all rustversion usage because it is redundant

* remove moved usage of rustversion
  • Loading branch information
kevinheavey authored Jun 27, 2024
1 parent 83527d9 commit 1d64076
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 22 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion gossip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion programs/sbf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion programs/sbf/rust/invoke/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
6 changes: 3 additions & 3 deletions programs/sbf/rust/invoke/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1457,7 +1457,7 @@ struct RcBox<T> {
value: T,
}

#[rustversion::attr(since(1.72), allow(invalid_reference_casting))]
#[allow(invalid_reference_casting)]
unsafe fn overwrite_account_data(account: &AccountInfo, data: Rc<RefCell<&mut [u8]>>) {
std::ptr::write_volatile(
&account.data as *const _ as usize as *mut Rc<RefCell<&mut [u8]>>,
Expand Down
1 change: 0 additions & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
1 change: 0 additions & 1 deletion sdk/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion sdk/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion sdk/program/src/account_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion sdk/program/src/program_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,6 @@ impl<T> From<Option<T>> for COption<T> {
}
}

#[rustversion::since(1.49.0)]
impl<T> From<COption<T>> for Option<T> {
fn from(coption: COption<T>) -> Self {
match coption {
Expand Down

0 comments on commit 1d64076

Please sign in to comment.