From 6ba9c12ff6309114fd22d56a9f4acf32284352f4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 25 Oct 2023 19:55:12 -0700 Subject: [PATCH] Float copysign does not exist in libcore yet --- serde/src/de/impls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 9b8755bd7..b7e4c549d 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -187,12 +187,12 @@ macro_rules! num_as_copysign_self { where E: Error, { - #[cfg(no_float_copysign)] + #[cfg(any(no_float_copysign, not(feature = "std")))] { Ok(v as Self::Value) } - #[cfg(not(no_float_copysign))] + #[cfg(all(not(no_float_copysign), feature = "std"))] { // Preserve sign of NaN. The `as` produces a nondeterministic sign. let sign = if v.is_sign_positive() { 1.0 } else { -1.0 };