From 2e778c7b5637971ca8d9f34b2d40079b2af33cff Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 25 Oct 2023 20:38:26 -0700 Subject: [PATCH] fix: Fix sign of NaNs produced by toml macro --- crates/toml/src/macros.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/toml/src/macros.rs b/crates/toml/src/macros.rs index d86cc52f..a2959700 100644 --- a/crates/toml/src/macros.rs +++ b/crates/toml/src/macros.rs @@ -198,15 +198,15 @@ macro_rules! toml_internal { }}; (@value (-nan)) => { - $crate::Value::Float(-::std::f64::NAN) + $crate::Value::Float(::std::f64::NAN.copysign(-1.0)) }; (@value (nan)) => { - $crate::Value::Float(::std::f64::NAN) + $crate::Value::Float(::std::f64::NAN.copysign(1.0)) }; (@value nan) => { - $crate::Value::Float(::std::f64::NAN) + $crate::Value::Float(::std::f64::NAN.copysign(1.0)) }; (@value (-inf)) => {