Merge pull request rust-lang/libm#368 from tgross35/rename-type-helpers
Rename associated type helpers, add `OpITy`
This commit is contained in:
commit
86afe0ff9c
3 changed files with 8 additions and 6 deletions
|
|
@ -26,7 +26,7 @@ macro_rules! musl_rand_benches {
|
|||
|
||||
#[cfg(feature = "build-musl")]
|
||||
let musl_extra = MuslExtra {
|
||||
musl_fn: Some(musl_math_sys::$fn_name as libm_test::CFn<Op>),
|
||||
musl_fn: Some(musl_math_sys::$fn_name as libm_test::OpCFn<Op>),
|
||||
skip_on_i586: $skip_on_i586
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ mod precision;
|
|||
mod test_traits;
|
||||
|
||||
pub use libm::support::{Float, Int, IntTy};
|
||||
pub use op::{BaseName, CFn, FTy, Identifier, MathOp, RustFn, RustRet};
|
||||
pub use op::{BaseName, Identifier, MathOp, OpCFn, OpFTy, OpRustFn, OpRustRet};
|
||||
pub use precision::{MaybeOverride, SpecialCase, default_ulp};
|
||||
pub use test_traits::{CheckBasis, CheckCtx, CheckOutput, GenerateInput, Hex, TupleCall};
|
||||
|
||||
|
|
|
|||
|
|
@ -71,13 +71,15 @@ pub trait MathOp {
|
|||
}
|
||||
|
||||
/// Access the associated `FTy` type from an op (helper to avoid ambiguous associated types).
|
||||
pub type FTy<Op> = <Op as MathOp>::FTy;
|
||||
pub type OpFTy<Op> = <Op as MathOp>::FTy;
|
||||
/// Access the associated `FTy::Int` type from an op (helper to avoid ambiguous associated types).
|
||||
pub type OpITy<Op> = <<Op as MathOp>::FTy as Float>::Int;
|
||||
/// Access the associated `CFn` type from an op (helper to avoid ambiguous associated types).
|
||||
pub type CFn<Op> = <Op as MathOp>::CFn;
|
||||
pub type OpCFn<Op> = <Op as MathOp>::CFn;
|
||||
/// Access the associated `RustFn` type from an op (helper to avoid ambiguous associated types).
|
||||
pub type RustFn<Op> = <Op as MathOp>::RustFn;
|
||||
pub type OpRustFn<Op> = <Op as MathOp>::RustFn;
|
||||
/// Access the associated `RustRet` type from an op (helper to avoid ambiguous associated types).
|
||||
pub type RustRet<Op> = <Op as MathOp>::RustRet;
|
||||
pub type OpRustRet<Op> = <Op as MathOp>::RustRet;
|
||||
|
||||
macro_rules! do_thing {
|
||||
// Matcher for unary functions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue