Przeglądaj źródła

Merge #67

67: Miscellaneous tweaks regarding no_std r=cuviper a=cuviper



Co-authored-by: Josh Stone <cuviper@gmail.com>
bors[bot] 7 lat temu
rodzic
commit
c3feb40897
3 zmienionych plików z 9 dodań i 4 usunięć
  1. 4 1
      Cargo.toml
  2. 3 1
      README.md
  3. 2 2
      src/lib.rs

+ 4 - 1
Cargo.toml

@@ -4,13 +4,16 @@ description = "Numeric traits for generic mathematics"
 documentation = "https://docs.rs/num-traits"
 homepage = "https://github.com/rust-num/num-traits"
 keywords = ["mathematics", "numerics"]
-categories = [ "algorithms", "science" ]
+categories = ["algorithms", "science", "no-std"]
 license = "MIT/Apache-2.0"
 repository = "https://github.com/rust-num/num-traits"
 name = "num-traits"
 version = "0.2.2"
 readme = "README.md"
 
+[package.metadata.docs.rs]
+all-features = true
+
 [dependencies]
 
 [features]

+ 3 - 1
README.md

@@ -34,7 +34,9 @@ default-features = false
 ```
 
 The `Float` and `Real` traits are only available when `std` is enabled. The
-`FloatCore` trait is always available.
+`FloatCore` trait is always available.  `MulAdd` and `MulAddAssign` for `f32`
+and `f64` also require `std`, as do implementations of signed and floating-
+point exponents in `Pow`.
 
 Implementations for `i128` and `u128` are only available when `i128` is enabled.
 

+ 2 - 2
src/lib.rs

@@ -18,9 +18,9 @@
 
 #![deny(unconditional_recursion)]
 
-#![cfg_attr(not(feature = "std"), no_std)]
+#![no_std]
 #[cfg(feature = "std")]
-extern crate core;
+extern crate std;
 
 use core::ops::{Add, Sub, Mul, Div, Rem};
 use core::ops::{AddAssign, SubAssign, MulAssign, DivAssign, RemAssign};