Skip to content

Commit 338d953

Browse files
committed
Replace libm_test::{Float, Int} with libm::{Float, Int}
This involves moving some things from full generic implementations (e.g. `impl<F: Float> SomeTrait for F { /* ... */ }` to generic functions and macros to implement traits that call them, due to orphan rule violations after `Float` became a not-in-crate trait. `Hex` was moved to `test_traits` so we can eliminate `num_traits`.
1 parent 80a0160 commit 338d953

File tree

4 files changed

+199
-283
lines changed

4 files changed

+199
-283
lines changed

crates/libm-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ short-benchmarks = []
2424
[dependencies]
2525
anyhow = "1.0.90"
2626
az = { version = "1.2.1", optional = true }
27-
libm = { path = "../.." }
27+
libm = { path = "../..", features = ["unstable-test-support"] }
2828
libm-macros = { path = "../libm-macros" }
2929
musl-math-sys = { path = "../musl-math-sys", optional = true }
3030
paste = "1.0.15"

crates/libm-test/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
pub mod gen;
22
#[cfg(feature = "test-multiprecision")]
33
pub mod mpfloat;
4-
mod num_traits;
54
mod precision;
65
mod test_traits;
76

8-
pub use num_traits::{Float, Hex, Int};
7+
pub use libm::support::{Float, Int};
98
pub use precision::{MaybeOverride, SpecialCase, multiprec_allowed_ulp, musl_allowed_ulp};
10-
pub use test_traits::{CheckBasis, CheckCtx, CheckOutput, GenerateInput, TupleCall};
9+
pub use test_traits::{CheckBasis, CheckCtx, CheckOutput, GenerateInput, Hex, TupleCall};
1110

1211
/// Result type for tests is usually from `anyhow`. Most times there is no success value to
1312
/// propagate.

crates/libm-test/src/num_traits.rs

Lines changed: 0 additions & 214 deletions
This file was deleted.

0 commit comments

Comments
 (0)