From 849e2a0b1b796959c6d277c1383b1d02349dab5d Mon Sep 17 00:00:00 2001 From: Yoan Lecoq Date: Sun, 3 Feb 2019 15:37:49 +0100 Subject: [PATCH] Always enable Real, feature gate Float - Real forwarding --- src/lib.rs | 1 - src/real.rs | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 273d98b..ce2874e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,6 @@ pub mod identities; pub mod int; pub mod ops; pub mod pow; -#[cfg(any(feature = "std", feature = "libm"))] pub mod real; pub mod sign; diff --git a/src/real.rs b/src/real.rs index 39eaa56..81467b7 100644 --- a/src/real.rs +++ b/src/real.rs @@ -1,6 +1,9 @@ use core::ops::Neg; -use {Float, Num, NumCast}; +use {Num, NumCast}; + +#[cfg(any(feature = "std", feature = "libm"))] +use Float; // NOTE: These doctests have the same issue as those in src/float.rs. // They're testing the inherent methods directly, and not those of `Real`. @@ -777,6 +780,7 @@ pub trait Real: Num + Copy + NumCast + PartialOrd + Neg { fn atanh(self) -> Self; } +#[cfg(any(feature = "std", feature = "libm"))] impl Real for T { forward! { Float::min_value() -> Self;