Преглед на файлове

Always enable Real, feature gate Float - Real forwarding

Yoan Lecoq преди 6 години
родител
ревизия
849e2a0b1b
променени са 2 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 0 1
      src/lib.rs
  2. 5 1
      src/real.rs

+ 0 - 1
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;
 

+ 5 - 1
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<Output = Self> {
     fn atanh(self) -> Self;
 }
 
+#[cfg(any(feature = "std", feature = "libm"))]
 impl<T: Float> Real for T {
     forward! {
         Float::min_value() -> Self;