Upgrade all dependencies to the latest

This is mostly done to get the latest version of `rand`, which includes
some breaking changes.
This commit is contained in:
Trevor Gross 2025-03-18 23:51:19 +00:00 committed by Trevor Gross
parent 1774882738
commit 725759602a
6 changed files with 20 additions and 25 deletions

View file

@ -59,8 +59,7 @@ exclude = [
]
[dev-dependencies]
no-panic = "0.1.33"
no-panic = "0.1.35"
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [

View file

@ -9,9 +9,9 @@ proc-macro = true
[dependencies]
heck = "0.5.0"
proc-macro2 = "1.0.93"
quote = "1.0.38"
syn = { version = "2.0.96", features = ["full", "extra-traits", "visit-mut"] }
proc-macro2 = "1.0.94"
quote = "1.0.40"
syn = { version = "2.0.100", features = ["full", "extra-traits", "visit-mut"] }
[lints.rust]
# Values used during testing

View file

@ -27,26 +27,22 @@ icount = ["dep:iai-callgrind"]
short-benchmarks = []
[dependencies]
anyhow = "1.0.95"
anyhow = "1.0.97"
# This is not directly used but is required so we can enable `gmp-mpfr-sys/force-cross`.
gmp-mpfr-sys = { version = "1.6.4", optional = true, default-features = false }
iai-callgrind = { version = "0.14.0", optional = true }
indicatif = { version = "0.17.9", default-features = false }
indicatif = { version = "0.17.11", default-features = false }
libm = { path = "../..", features = ["unstable-public-internals"] }
libm-macros = { path = "../libm-macros" }
musl-math-sys = { path = "../musl-math-sys", optional = true }
paste = "1.0.15"
rand = "0.8.5"
rand_chacha = "0.3.1"
rand = "0.9.0"
rand_chacha = "0.9.0"
rayon = "1.10.0"
rug = { version = "1.27.0", optional = true, default-features = false, features = ["float", "integer", "std"] }
[target.'cfg(target_family = "wasm")'.dependencies]
# Enable randomness on WASM
getrandom = { version = "0.2", features = ["js"] }
[build-dependencies]
rand = { version = "0.8.5", optional = true }
rand = { version = "0.9.0", optional = true }
[dev-dependencies]
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }

View file

@ -3,7 +3,7 @@ use std::ops::RangeInclusive;
use std::sync::LazyLock;
use libm::support::Float;
use rand::distributions::{Alphanumeric, Standard};
use rand::distr::{Alphanumeric, StandardUniform};
use rand::prelude::Distribution;
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;
@ -16,7 +16,7 @@ pub(crate) const SEED_ENV: &str = "LIBM_SEED";
pub static SEED: LazyLock<[u8; 32]> = LazyLock::new(|| {
let s = env::var(SEED_ENV).unwrap_or_else(|_| {
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
(0..32).map(|_| rng.sample(Alphanumeric) as char).collect()
});
@ -33,19 +33,19 @@ pub trait RandomInput: Sized {
/// Generate a sequence of deterministically random floats.
fn random_floats<F: Float>(count: u64) -> impl Iterator<Item = F>
where
Standard: Distribution<F::Int>,
StandardUniform: Distribution<F::Int>,
{
let mut rng = ChaCha8Rng::from_seed(*SEED);
// Generate integers to get a full range of bitpatterns (including NaNs), then convert back
// to the float type.
(0..count).map(move |_| F::from_bits(rng.gen::<F::Int>()))
(0..count).map(move |_| F::from_bits(rng.random::<F::Int>()))
}
/// Generate a sequence of deterministically random `i32`s within a specified range.
fn random_ints(count: u64, range: RangeInclusive<i32>) -> impl Iterator<Item = i32> {
let mut rng = ChaCha8Rng::from_seed(*SEED);
(0..count).map(move |_| rng.gen_range::<i32, _>(range.clone()))
(0..count).map(move |_| rng.random_range::<i32, _>(range.clone()))
}
macro_rules! impl_random_input {

View file

@ -25,8 +25,8 @@ fn hexu(v: u256) -> String {
}
fn random_u256(rng: &mut ChaCha8Rng) -> u256 {
let lo: u128 = rng.gen();
let hi: u128 = rng.gen();
let lo: u128 = rng.random();
let hi: u128 = rng.random();
u256 { lo, hi }
}
@ -121,7 +121,7 @@ fn mp_u256_shr() {
for _ in 0..bigint_fuzz_iteration_count() {
let x = random_u256(&mut rng);
let shift: u32 = rng.gen_range(0..255);
let shift: u32 = rng.random_range(0..255);
assign_bigint(&mut bx, x);
let actual = x >> shift;
bx >>= shift;
@ -136,8 +136,8 @@ fn mp_u256_widen_mul() {
let mut by = BigInt::new();
for _ in 0..bigint_fuzz_iteration_count() {
let x: u128 = rng.gen();
let y: u128 = rng.gen();
let x: u128 = rng.random();
let y: u128 = rng.random();
bx.assign(x);
by.assign(y);
let actual = x.widen_mul(y);

View file

@ -10,4 +10,4 @@ publish = false
libm = { path = "../../" }
[build-dependencies]
cc = "1.2.10"
cc = "1.2.16"