Don't use libm at all with std

This commit is contained in:
Josh Stone 2019-09-27 10:53:12 -07:00
parent b64ee3809c
commit c4256bd4df
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ use core::f64;
use {Num, NumCast, ToPrimitive}; use {Num, NumCast, ToPrimitive};
#[cfg(feature = "libm")] #[cfg(all(not(feature = "std"), feature = "libm"))]
use libm::{F32Ext, F64Ext}; use libm::{F32Ext, F64Ext};
/// Generic trait for floating point numbers that works with `no_std`. /// Generic trait for floating point numbers that works with `no_std`.
@ -1887,7 +1887,7 @@ macro_rules! float_impl_std {
}; };
} }
#[cfg(feature = "libm")] #[cfg(all(not(feature = "std"), feature = "libm"))]
macro_rules! float_impl_libm { macro_rules! float_impl_libm {
($T:ident $decode:ident $LibmImpl:ident) => { ($T:ident $decode:ident $LibmImpl:ident) => {
impl Float for $T { impl Float for $T {

View File

@ -20,7 +20,8 @@
#[cfg(feature = "std")] #[cfg(feature = "std")]
extern crate std; extern crate std;
#[cfg(feature = "libm")] // Only `no_std` builds actually use `libm`.
#[cfg(all(not(feature = "std"), feature = "libm"))]
extern crate libm; extern crate libm;
use core::fmt; use core::fmt;