Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 83b37a0

Browse files
authored
Merge pull request #368 from tgross35/rename-type-helpers
Rename associated type helpers, add `OpITy`
2 parents ebdb38b + 80def21 commit 83b37a0

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

crates/libm-test/benches/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ macro_rules! musl_rand_benches {
2626

2727
#[cfg(feature = "build-musl")]
2828
let musl_extra = MuslExtra {
29-
musl_fn: Some(musl_math_sys::$fn_name as libm_test::CFn<Op>),
29+
musl_fn: Some(musl_math_sys::$fn_name as libm_test::OpCFn<Op>),
3030
skip_on_i586: $skip_on_i586
3131
};
3232

crates/libm-test/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod precision;
66
mod test_traits;
77

88
pub use libm::support::{Float, Int, IntTy};
9-
pub use op::{BaseName, CFn, FTy, Identifier, MathOp, RustFn, RustRet};
9+
pub use op::{BaseName, Identifier, MathOp, OpCFn, OpFTy, OpRustFn, OpRustRet};
1010
pub use precision::{MaybeOverride, SpecialCase, default_ulp};
1111
pub use test_traits::{CheckBasis, CheckCtx, CheckOutput, GenerateInput, Hex, TupleCall};
1212

crates/libm-test/src/op.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ pub trait MathOp {
7171
}
7272

7373
/// Access the associated `FTy` type from an op (helper to avoid ambiguous associated types).
74-
pub type FTy<Op> = <Op as MathOp>::FTy;
74+
pub type OpFTy<Op> = <Op as MathOp>::FTy;
75+
/// Access the associated `FTy::Int` type from an op (helper to avoid ambiguous associated types).
76+
pub type OpITy<Op> = <<Op as MathOp>::FTy as Float>::Int;
7577
/// Access the associated `CFn` type from an op (helper to avoid ambiguous associated types).
76-
pub type CFn<Op> = <Op as MathOp>::CFn;
78+
pub type OpCFn<Op> = <Op as MathOp>::CFn;
7779
/// Access the associated `RustFn` type from an op (helper to avoid ambiguous associated types).
78-
pub type RustFn<Op> = <Op as MathOp>::RustFn;
80+
pub type OpRustFn<Op> = <Op as MathOp>::RustFn;
7981
/// Access the associated `RustRet` type from an op (helper to avoid ambiguous associated types).
80-
pub type RustRet<Op> = <Op as MathOp>::RustRet;
82+
pub type OpRustRet<Op> = <Op as MathOp>::RustRet;
8183

8284
macro_rules! do_thing {
8385
// Matcher for unary functions

0 commit comments

Comments
 (0)