Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions frozen-abi-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ fn quote_for_test(
quote! {
#[test]
fn test_abi_digest() {
use ::rand::{SeedableRng, RngCore};
use ::rand_chacha::ChaCha8Rng;
use ::bincode;
use ::solana_frozen_abi::rand::{SeedableRng, RngCore};
use ::solana_frozen_abi::rand_chacha::ChaCha8Rng;
use ::solana_frozen_abi::bincode;
use ::solana_frozen_abi::stable_abi::StableAbi;

let mut rng = ChaCha8Rng::seed_from_u64(20666175621446498);
Expand Down
8 changes: 7 additions & 1 deletion frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ solana-frozen-abi-macro = { workspace = true }
thiserror = { workspace = true }

[target.'cfg(not(target_os = "solana"))'.dependencies]
# These dependencies are used only to back `frozen-abi` StableAbi API,
# to avoid version skew and keep digest computation stable regardless of consumer dependencies.
bincode = "1.3.3"
im = { workspace = true, features = ["rayon", "serde"] }
memmap2 = { workspace = true }
rand = { workspace = true }
# These dependencies are used only to back `frozen-abi` StableAbi API,
# to avoid version skew and keep digest computation stable regardless of consumer dependencies.
rand = "0.8.5"
rand_chacha = "0.3.1"

[target.'cfg(not(target_os = "solana"))'.dev-dependencies]
bitflags = { workspace = true, features = ["serde"] }
Expand Down
14 changes: 12 additions & 2 deletions frozen-abi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#![allow(incomplete_features)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(feature = "frozen-abi", feature(specialization))]
// Activate some of the Rust 2024 lints to make the future migration easier.
#![warn(if_let_rescope)]
#![warn(keyword_idents_2024)]
#![warn(rust_2024_incompatible_pat)]
#![warn(tail_expr_drop_order)]
#![warn(unsafe_attr_outside_unsafe)]
#![warn(unsafe_op_in_unsafe_fn)]

// Allows macro expansion of `use ::solana_frozen_abi::*` to work within this crate
extern crate self as solana_frozen_abi;
Expand All @@ -11,14 +18,17 @@ pub mod abi_digester;
pub mod abi_example;
#[cfg(feature = "frozen-abi")]
pub mod hash;
#[cfg(feature = "frozen-abi")]
#[cfg(not(target_os = "solana"))]

#[cfg(all(feature = "frozen-abi", not(target_os = "solana")))]
pub mod stable_abi;

#[cfg(feature = "frozen-abi")]
#[macro_use]
extern crate solana_frozen_abi_macro;

#[cfg(all(feature = "frozen-abi", not(target_os = "solana")))]
pub use {bincode, rand, rand_chacha};

// Not public API. Previously referenced by macro-generated code. Remove the
// `log` dependency from Cargo.toml when this is cleaned up in the next major
// version bump
Expand Down
2 changes: 1 addition & 1 deletion frozen-abi/src/stable_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ pub trait StableAbi: Sized {
where
Standard: rand::distributions::Distribution<Self>,
{
rng.gen::<Self>()
rng.r#gen::<Self>()
}
}