From 00c3b6d68e1a50bb9323b13ae5cf1ab3820da56d Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 11 Sep 2024 19:29:51 -0700 Subject: [PATCH] Use -0.0 as the neutral additive float -0.0 + 0.0 is 0.0 -0.0 + -0.0 is -0.0 Thus, the float additive-zero is actually -0.0, not its positive cousin. This change aligns with a recent change to the impl of Sum for floats, in rust-lang/rust@490818851860fb257e23fe7aa0ee32eaffc4ba40 and accordingly we also have to use the latest toolchain for our tests now. --- crates/core_simd/src/simd/num/float.rs | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/core_simd/src/simd/num/float.rs b/crates/core_simd/src/simd/num/float.rs index 48bfca32d53..79954b937b3 100644 --- a/crates/core_simd/src/simd/num/float.rs +++ b/crates/core_simd/src/simd/num/float.rs @@ -419,7 +419,7 @@ macro_rules! impl_trait { self.as_array().iter().sum() } else { // Safety: `self` is a float vector - unsafe { core::intrinsics::simd::simd_reduce_add_ordered(self, 0.) } + unsafe { core::intrinsics::simd::simd_reduce_add_ordered(self, -0.) } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 811fdb49cdb..d6239a040a5 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-06-13" +channel = "nightly-2024-09-11" components = ["rustfmt", "clippy", "miri", "rust-src"]