Skip to content

Commit 0bb8532

Browse files
committed
Upgrade all dependencies to the latest
This is mostly done to get the latest version of `rand`, which includes some breaking changes.
1 parent 519de42 commit 0bb8532

File tree

6 files changed

+20
-25
lines changed

6 files changed

+20
-25
lines changed

libm/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ exclude = [
5959
]
6060

6161
[dev-dependencies]
62-
no-panic = "0.1.33"
63-
62+
no-panic = "0.1.35"
6463

6564
[lints.rust]
6665
unexpected_cfgs = { level = "warn", check-cfg = [

libm/crates/libm-macros/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ proc-macro = true
99

1010
[dependencies]
1111
heck = "0.5.0"
12-
proc-macro2 = "1.0.93"
13-
quote = "1.0.38"
14-
syn = { version = "2.0.96", features = ["full", "extra-traits", "visit-mut"] }
12+
proc-macro2 = "1.0.94"
13+
quote = "1.0.40"
14+
syn = { version = "2.0.100", features = ["full", "extra-traits", "visit-mut"] }
1515

1616
[lints.rust]
1717
# Values used during testing

libm/crates/libm-test/Cargo.toml

+5-9
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,22 @@ icount = ["dep:iai-callgrind"]
2727
short-benchmarks = []
2828

2929
[dependencies]
30-
anyhow = "1.0.95"
30+
anyhow = "1.0.97"
3131
# This is not directly used but is required so we can enable `gmp-mpfr-sys/force-cross`.
3232
gmp-mpfr-sys = { version = "1.6.4", optional = true, default-features = false }
3333
iai-callgrind = { version = "0.14.0", optional = true }
34-
indicatif = { version = "0.17.9", default-features = false }
34+
indicatif = { version = "0.17.11", default-features = false }
3535
libm = { path = "../..", features = ["unstable-public-internals"] }
3636
libm-macros = { path = "../libm-macros" }
3737
musl-math-sys = { path = "../musl-math-sys", optional = true }
3838
paste = "1.0.15"
39-
rand = "0.8.5"
40-
rand_chacha = "0.3.1"
39+
rand = "0.9.0"
40+
rand_chacha = "0.9.0"
4141
rayon = "1.10.0"
4242
rug = { version = "1.27.0", optional = true, default-features = false, features = ["float", "integer", "std"] }
4343

44-
[target.'cfg(target_family = "wasm")'.dependencies]
45-
# Enable randomness on WASM
46-
getrandom = { version = "0.2", features = ["js"] }
47-
4844
[build-dependencies]
49-
rand = { version = "0.8.5", optional = true }
45+
rand = { version = "0.9.0", optional = true }
5046

5147
[dev-dependencies]
5248
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }

libm/crates/libm-test/src/gen/random.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::ops::RangeInclusive;
33
use std::sync::LazyLock;
44

55
use libm::support::Float;
6-
use rand::distributions::{Alphanumeric, Standard};
6+
use rand::distr::{Alphanumeric, StandardUniform};
77
use rand::prelude::Distribution;
88
use rand::{Rng, SeedableRng};
99
use rand_chacha::ChaCha8Rng;
@@ -16,7 +16,7 @@ pub(crate) const SEED_ENV: &str = "LIBM_SEED";
1616

1717
pub static SEED: LazyLock<[u8; 32]> = LazyLock::new(|| {
1818
let s = env::var(SEED_ENV).unwrap_or_else(|_| {
19-
let mut rng = rand::thread_rng();
19+
let mut rng = rand::rng();
2020
(0..32).map(|_| rng.sample(Alphanumeric) as char).collect()
2121
});
2222

@@ -33,19 +33,19 @@ pub trait RandomInput: Sized {
3333
/// Generate a sequence of deterministically random floats.
3434
fn random_floats<F: Float>(count: u64) -> impl Iterator<Item = F>
3535
where
36-
Standard: Distribution<F::Int>,
36+
StandardUniform: Distribution<F::Int>,
3737
{
3838
let mut rng = ChaCha8Rng::from_seed(*SEED);
3939

4040
// Generate integers to get a full range of bitpatterns (including NaNs), then convert back
4141
// to the float type.
42-
(0..count).map(move |_| F::from_bits(rng.gen::<F::Int>()))
42+
(0..count).map(move |_| F::from_bits(rng.random::<F::Int>()))
4343
}
4444

4545
/// Generate a sequence of deterministically random `i32`s within a specified range.
4646
fn random_ints(count: u64, range: RangeInclusive<i32>) -> impl Iterator<Item = i32> {
4747
let mut rng = ChaCha8Rng::from_seed(*SEED);
48-
(0..count).map(move |_| rng.gen_range::<i32, _>(range.clone()))
48+
(0..count).map(move |_| rng.random_range::<i32, _>(range.clone()))
4949
}
5050

5151
macro_rules! impl_random_input {

libm/crates/libm-test/tests/u256.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fn hexu(v: u256) -> String {
2525
}
2626

2727
fn random_u256(rng: &mut ChaCha8Rng) -> u256 {
28-
let lo: u128 = rng.gen();
29-
let hi: u128 = rng.gen();
28+
let lo: u128 = rng.random();
29+
let hi: u128 = rng.random();
3030
u256 { lo, hi }
3131
}
3232

@@ -121,7 +121,7 @@ fn mp_u256_shr() {
121121

122122
for _ in 0..bigint_fuzz_iteration_count() {
123123
let x = random_u256(&mut rng);
124-
let shift: u32 = rng.gen_range(0..255);
124+
let shift: u32 = rng.random_range(0..255);
125125
assign_bigint(&mut bx, x);
126126
let actual = x >> shift;
127127
bx >>= shift;
@@ -136,8 +136,8 @@ fn mp_u256_widen_mul() {
136136
let mut by = BigInt::new();
137137

138138
for _ in 0..bigint_fuzz_iteration_count() {
139-
let x: u128 = rng.gen();
140-
let y: u128 = rng.gen();
139+
let x: u128 = rng.random();
140+
let y: u128 = rng.random();
141141
bx.assign(x);
142142
by.assign(y);
143143
let actual = x.widen_mul(y);

libm/crates/musl-math-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ publish = false
1010
libm = { path = "../../" }
1111

1212
[build-dependencies]
13-
cc = "1.2.10"
13+
cc = "1.2.16"

0 commit comments

Comments
 (0)