瀏覽代碼

Guard Real trait definition like its blanket impl for Float

Yoan Lecoq 5 年之前
父節點
當前提交
4b1ea5fb12
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/real.rs

+ 1 - 0
src/real.rs

@@ -16,6 +16,7 @@ use Float;
 ///
 /// This trait is always available, however it requires either `std` or `libm`
 /// in order for `f32` and `f64` to implement it.
+#[cfg(any(feature = "std", feature = "libm"))]
 pub trait Real: Num + Copy + NumCast + PartialOrd + Neg<Output = Self> {
     /// Returns the smallest finite value that this type can represent.
     ///