diff --git a/Cargo.toml b/Cargo.toml index c9cb6d5..98d7ca9 100644 --- a/Cargo.toml +++ b/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] diff --git a/README.md b/README.md index 3aab842..2c16617 100644 --- a/README.md +++ b/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. diff --git a/src/lib.rs b/src/lib.rs index 552051c..47a3bfa 100644 --- a/src/lib.rs +++ b/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};