Skip to content

Commit 46a3bce

Browse files
authored
Merge pull request rust-lang#477 from tgross35/upgrade-dependencies
Upgrade all dependencies to the latest version
2 parents b67b4cc + 857ba9c commit 46a3bce

File tree

8 files changed

+19
-88
lines changed

8 files changed

+19
-88
lines changed

Cargo.toml

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

6161
[dev-dependencies]
62-
no-panic = "0.1.30"
62+
no-panic = "0.1.33"
6363

6464
[profile.release]
6565
# Options for no-panic to correctly detect the lack of panics

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.88"
13-
quote = "1.0.37"
14-
syn = { version = "2.0.79", features = ["full", "extra-traits", "visit-mut"] }
12+
proc-macro2 = "1.0.93"
13+
quote = "1.0.38"
14+
syn = { version = "2.0.96", features = ["full", "extra-traits", "visit-mut"] }
1515

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

crates/libm-test/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ unstable-float = ["libm/unstable-float", "rug?/nightly-float"]
1212

1313
# Generate tests which are random inputs and the outputs are calculated with
1414
# musl libc.
15-
build-mpfr = ["dep:az", "dep:rug", "dep:gmp-mpfr-sys"]
15+
build-mpfr = ["dep:rug", "dep:gmp-mpfr-sys"]
1616

1717
# Build our own musl for testing and benchmarks
1818
build-musl = ["dep:musl-math-sys"]
@@ -27,9 +27,9 @@ icount = ["dep:iai-callgrind"]
2727
short-benchmarks = []
2828

2929
[dependencies]
30-
anyhow = "1.0.90"
31-
az = { version = "1.2.1", optional = true }
32-
gmp-mpfr-sys = { version = "1.6.4", optional = true, default-features = false, features = ["mpfr"] }
30+
anyhow = "1.0.95"
31+
# This is not directly used but is required so we can enable `gmp-mpfr-sys/force-cross`.
32+
gmp-mpfr-sys = { version = "1.6.4", optional = true, default-features = false }
3333
iai-callgrind = { version = "0.14.0", optional = true }
3434
indicatif = { version = "0.17.9", default-features = false }
3535
libm = { path = "../..", features = ["unstable-public-internals"] }
@@ -39,7 +39,7 @@ paste = "1.0.15"
3939
rand = "0.8.5"
4040
rand_chacha = "0.3.1"
4141
rayon = "1.10.0"
42-
rug = { version = "1.26.1", optional = true, default-features = false, features = ["float", "integer", "std"] }
42+
rug = { version = "1.27.0", optional = true, default-features = false, features = ["float", "integer", "std"] }
4343

4444
[target.'cfg(target_family = "wasm")'.dependencies]
4545
# Enable randomness on WASM

crates/libm-test/src/mpfloat.rs

+5-42
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
//! a struct named `Operation` that implements [`MpOp`].
55
66
use std::cmp::Ordering;
7-
use std::ffi::{c_int, c_long};
87

9-
use az::Az;
10-
use gmp_mpfr_sys::mpfr::rnd_t;
118
use rug::Assign;
129
pub use rug::Float as MpFloat;
13-
use rug::float::Round;
10+
use rug::az::{self, Az};
1411
use rug::float::Round::Nearest;
1512
use rug::ops::{PowAssignRound, RemAssignRound};
1613

@@ -310,13 +307,8 @@ macro_rules! impl_op_for_ty {
310307
}
311308

312309
fn run(this: &mut Self::MpTy, input: Self::RustArgs) -> Self::RustRet {
313-
// Implementation taken from `rug::Float::to_f32_exp`.
314310
this.assign(input.0);
315-
let exp = this.get_exp().unwrap_or(0);
316-
if exp != 0 {
317-
*this >>= exp;
318-
}
319-
311+
let exp = this.frexp_mut();
320312
(prep_retval::<Self::FTy>(this, Ordering::Equal), exp)
321313
}
322314
}
@@ -406,28 +398,20 @@ macro_rules! impl_op_for_ty {
406398
}
407399

408400
impl MpOp for crate::op::[<remquo $suffix>]::Routine {
409-
type MpTy = (MpFloat, MpFloat, MpFloat);
401+
type MpTy = (MpFloat, MpFloat);
410402

411403
fn new_mp() -> Self::MpTy {
412404
(
413405
new_mpfloat::<Self::FTy>(),
414406
new_mpfloat::<Self::FTy>(),
415-
new_mpfloat::<Self::FTy>()
416407
)
417408
}
418409

419410
fn run(this: &mut Self::MpTy, input: Self::RustArgs) -> Self::RustRet {
420411
this.0.assign(input.0);
421412
this.1.assign(input.1);
422-
let (ord, ql) = mpfr_remquo(&mut this.2, &this.0, &this.1, Nearest);
423-
424-
// `remquo` integer results are sign-magnitude representation. Transfer the
425-
// sign bit from the long result to the int result.
426-
let clear = !(1 << (c_int::BITS - 1));
427-
let sign = ((ql >> (c_long::BITS - 1)) as i32) << (c_int::BITS - 1);
428-
let q = (ql as i32) & clear | sign;
429-
430-
(prep_retval::<Self::FTy>(&mut this.2, ord), q)
413+
let (ord, q) = this.0.remainder_quo31_round(&this.1, Nearest);
414+
(prep_retval::<Self::FTy>(&mut this.0, ord), q)
431415
}
432416
}
433417

@@ -552,24 +536,3 @@ impl MpOp for crate::op::nextafterf::Routine {
552536
unimplemented!("nextafter does not yet have a MPFR operation");
553537
}
554538
}
555-
556-
/// `rug` does not provide `remquo` so this exposes `mpfr_remquo`. See rug#76.
557-
fn mpfr_remquo(r: &mut MpFloat, x: &MpFloat, y: &MpFloat, round: Round) -> (Ordering, c_long) {
558-
let r = r.as_raw_mut();
559-
let x = x.as_raw();
560-
let y = y.as_raw();
561-
let mut q: c_long = 0;
562-
563-
let round = match round {
564-
Round::Nearest => rnd_t::RNDN,
565-
Round::Zero => rnd_t::RNDZ,
566-
Round::Up => rnd_t::RNDU,
567-
Round::Down => rnd_t::RNDD,
568-
Round::AwayZero => rnd_t::RNDA,
569-
_ => unreachable!(),
570-
};
571-
572-
// SAFETY: mutable and const pointers are valid and do not alias, by Rust's rules.
573-
let ord = unsafe { gmp_mpfr_sys::mpfr::remquo(r, &mut q, x, y, round) };
574-
(ord.cmp(&0), q)
575-
}

crates/libm-test/src/precision.rs

-31
Original file line numberDiff line numberDiff line change
@@ -405,15 +405,6 @@ impl MaybeOverride<(f32, f32)> for SpecialCase {
405405
) -> CheckAction {
406406
binop_common(input, actual, expected, ctx)
407407
}
408-
409-
fn check_int<I: Int>(
410-
_input: (f32, f32),
411-
actual: I,
412-
expected: I,
413-
ctx: &CheckCtx,
414-
) -> CheckAction {
415-
remquo_common(actual, expected, ctx)
416-
}
417408
}
418409

419410
impl MaybeOverride<(f64, f64)> for SpecialCase {
@@ -425,15 +416,6 @@ impl MaybeOverride<(f64, f64)> for SpecialCase {
425416
) -> CheckAction {
426417
binop_common(input, actual, expected, ctx)
427418
}
428-
429-
fn check_int<I: Int>(
430-
_input: (f64, f64),
431-
actual: I,
432-
expected: I,
433-
ctx: &CheckCtx,
434-
) -> CheckAction {
435-
remquo_common(actual, expected, ctx)
436-
}
437419
}
438420

439421
#[cfg(f128_enabled)]
@@ -496,19 +478,6 @@ fn binop_common<F1: Float, F2: Float>(
496478
DEFAULT
497479
}
498480

499-
fn remquo_common<I: Int>(actual: I, expected: I, ctx: &CheckCtx) -> CheckAction {
500-
// FIXME: Our MPFR implementation disagrees with musl and may need to be updated.
501-
if ctx.basis == CheckBasis::Mpfr
502-
&& ctx.base_name == BaseName::Remquo
503-
&& expected == I::MIN
504-
&& actual == I::ZERO
505-
{
506-
return XFAIL("remquo integer mismatch");
507-
}
508-
509-
DEFAULT
510-
}
511-
512481
impl MaybeOverride<(i32, f32)> for SpecialCase {
513482
fn check_float<F: Float>(
514483
input: (i32, f32),

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.1.24"
13+
cc = "1.2.10"

crates/util/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ publish = false
77
[features]
88
default = ["build-musl", "build-mpfr", "unstable-float"]
99
build-musl = ["libm-test/build-musl", "dep:musl-math-sys"]
10-
build-mpfr = ["libm-test/build-mpfr", "dep:az", "dep:rug"]
10+
build-mpfr = ["libm-test/build-mpfr", "dep:rug"]
1111
unstable-float = ["libm/unstable-float", "libm-test/unstable-float", "rug?/nightly-float"]
1212

1313
[dependencies]
14-
az = { version = "1.2.1", optional = true }
1514
libm = { path = "../..", default-features = false }
1615
libm-macros = { path = "../libm-macros" }
1716
libm-test = { path = "../libm-test", default-features = false }
1817
musl-math-sys = { path = "../musl-math-sys", optional = true }
19-
rug = { version = "1.26.1", optional = true, default-features = false, features = ["float", "std"] }
18+
rug = { version = "1.27.0", optional = true, default-features = false, features = ["float", "std"] }

crates/util/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use std::env;
88
use std::num::ParseIntError;
99
use std::str::FromStr;
1010

11-
#[cfg(feature = "build-mpfr")]
12-
use az::Az;
1311
use libm::support::{hf32, hf64};
1412
#[cfg(feature = "build-mpfr")]
1513
use libm_test::mpfloat::MpOp;
1614
use libm_test::{MathOp, TupleCall};
15+
#[cfg(feature = "build-mpfr")]
16+
use rug::az::{self, Az};
1717

1818
const USAGE: &str = "\
1919
usage:

0 commit comments

Comments
 (0)