Always enable Real, feature gate Float - Real forwarding

This commit is contained in:
Yoan Lecoq 2019-02-03 15:37:49 +01:00 committed by Josh Stone
parent 4234eb76aa
commit 849e2a0b1b
2 changed files with 5 additions and 2 deletions

View File

@ -56,7 +56,6 @@ pub mod identities;
pub mod int; pub mod int;
pub mod ops; pub mod ops;
pub mod pow; pub mod pow;
#[cfg(any(feature = "std", feature = "libm"))]
pub mod real; pub mod real;
pub mod sign; pub mod sign;

View File

@ -1,6 +1,9 @@
use core::ops::Neg; 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. // 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`. // They're testing the inherent methods directly, and not those of `Real`.
@ -777,6 +780,7 @@ pub trait Real: Num + Copy + NumCast + PartialOrd + Neg<Output = Self> {
fn atanh(self) -> Self; fn atanh(self) -> Self;
} }
#[cfg(any(feature = "std", feature = "libm"))]
impl<T: Float> Real for T { impl<T: Float> Real for T {
forward! { forward! {
Float::min_value() -> Self; Float::min_value() -> Self;