From a2dd8cda7ccb5e6e0e7011477b412a6ce0a65ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Sun, 27 Sep 2026 15:18:33 +0200 Subject: [PATCH 1/2] fix(dasp_signal): make it build again without `std` on the latest nightlies Rust PR https://github.com/rust-lang/rust/pull/160989, which is already part of the latest 1.100 nightlies, changed several unstable `core::intrinsics` functions to be generic, which implied a breaking name change. Unfortunately, these are used by `dasp_signal` when the `std` feature is not enabled. These changes make `dasp_signal` use the new intrinsic names, so that builds without the `std` feature work again on the latest nightlies. People that have to keep using older nightlies for any reason may temporarily pin their dependency on `dasp_signal` to a version compatible with their nightly build. While at it, I have also realized that such intrinsics have not been unsafe for a while now, so I removed their surrounding `unsafe` blocks. --- dasp_signal/src/ops.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dasp_signal/src/ops.rs b/dasp_signal/src/ops.rs index 5df09ba2..92feb716 100644 --- a/dasp_signal/src/ops.rs +++ b/dasp_signal/src/ops.rs @@ -4,7 +4,7 @@ pub mod f64 { #[cfg(not(feature = "std"))] pub fn floor(x: f64) -> f64 { - unsafe { core::intrinsics::floorf64(x) } + core::intrinsics::floorf64(x) } #[cfg(feature = "std")] pub fn floor(x: f64) -> f64 { @@ -14,7 +14,7 @@ pub mod f64 { #[cfg(not(feature = "std"))] #[allow(dead_code)] pub fn ceil(x: f64) -> f64 { - unsafe { core::intrinsics::ceilf64(x) } + core::intrinsics::ceilf64(x) } #[cfg(feature = "std")] #[allow(dead_code)] @@ -24,7 +24,7 @@ pub mod f64 { #[cfg(not(feature = "std"))] pub fn sin(x: f64) -> f64 { - unsafe { core::intrinsics::sinf64(x) } + core::intrinsics::sin(x) } #[cfg(feature = "std")] pub fn sin(x: f64) -> f64 { From 2bb316a7d2644b7ea136174cd446efe9696b5270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Sun, 27 Sep 2026 15:39:50 +0200 Subject: [PATCH 2/2] fix: make several crates build again without `std` on the latest nightlies --- dasp_envelope/src/detect/ops.rs | 2 +- dasp_interpolate/src/sinc/ops.rs | 4 ++-- dasp_window/src/hann/ops.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dasp_envelope/src/detect/ops.rs b/dasp_envelope/src/detect/ops.rs index 252c7667..ee15707a 100644 --- a/dasp_envelope/src/detect/ops.rs +++ b/dasp_envelope/src/detect/ops.rs @@ -7,6 +7,6 @@ pub mod f32 { } #[cfg(not(feature = "std"))] pub fn powf32(a: f32, b: f32) -> f32 { - unsafe { core::intrinsics::powf32(a, b) } + core::intrinsics::powf32(a, b) } } diff --git a/dasp_interpolate/src/sinc/ops.rs b/dasp_interpolate/src/sinc/ops.rs index edc9b7a0..2857cd46 100644 --- a/dasp_interpolate/src/sinc/ops.rs +++ b/dasp_interpolate/src/sinc/ops.rs @@ -3,7 +3,7 @@ pub mod f64 { #[cfg(not(feature = "std"))] pub fn sin(x: f64) -> f64 { - unsafe { core::intrinsics::sinf64(x) } + core::intrinsics::sin(x) } #[cfg(feature = "std")] pub fn sin(x: f64) -> f64 { @@ -12,7 +12,7 @@ pub mod f64 { #[cfg(not(feature = "std"))] pub fn cos(x: f64) -> f64 { - unsafe { core::intrinsics::cosf64(x) } + core::intrinsics::cos(x) } #[cfg(feature = "std")] pub fn cos(x: f64) -> f64 { diff --git a/dasp_window/src/hann/ops.rs b/dasp_window/src/hann/ops.rs index f37cda1f..628c7186 100644 --- a/dasp_window/src/hann/ops.rs +++ b/dasp_window/src/hann/ops.rs @@ -3,7 +3,7 @@ pub mod f64 { #[cfg(not(feature = "std"))] pub fn cos(x: f64) -> f64 { - unsafe { core::intrinsics::cosf64(x) } + core::intrinsics::cos(x) } #[cfg(feature = "std")] pub fn cos(x: f64) -> f64 {