diff --git a/crates/core_arch/src/lib.rs b/crates/core_arch/src/lib.rs index 7c20d9470a..096b283e3c 100644 --- a/crates/core_arch/src/lib.rs +++ b/crates/core_arch/src/lib.rs @@ -37,7 +37,8 @@ sha512_sm_x86, x86_amx_intrinsics, f16, - rustc_allow_const_fn_unstable + rustc_allow_const_fn_unstable, + wasm_simd_const_internals )] #![cfg_attr(test, feature(test, abi_vectorcall, stdarch_internal))] #![deny(clippy::missing_inline_in_public_items)] @@ -73,10 +74,6 @@ stdarch_loongarch_feature_detection ) )] -#![cfg_attr( - any(target_arch = "wasm32", target_arch = "wasm64", doc), - feature(wasm_simd_const_internals) -)] #[cfg(test)] #[macro_use] diff --git a/crates/core_arch/src/simd.rs b/crates/core_arch/src/simd.rs index 3a53e54b3c..1939a8bc89 100644 --- a/crates/core_arch/src/simd.rs +++ b/crates/core_arch/src/simd.rs @@ -11,6 +11,7 @@ macro_rules! simd_ty { #[allow(clippy::use_self)] impl $id { #[inline(always)] + #[rustc_const_unstable(feature = "wasm_simd_const_internals", issue = "none")] // FIXME remove when const-stability v2 migration is done pub(crate) const fn new($($param_name: $elem_type),*) -> Self { $id([$($param_name),*]) } @@ -52,11 +53,13 @@ macro_rules! simd_m_ty { #[allow(clippy::use_self)] impl $id { #[inline(always)] + #[rustc_const_unstable(feature = "wasm_simd_const_internals", issue = "none")] // FIXME remove when const-stability v2 migration is done const fn bool_to_internal(x: bool) -> $elem_type { [0 as $elem_type, !(0 as $elem_type)][x as usize] } #[inline(always)] + #[rustc_const_unstable(feature = "wasm_simd_const_internals", issue = "none")] // FIXME remove when const-stability v2 migration is done pub(crate) const fn new($($param_name: bool),*) -> Self { $id([$(Self::bool_to_internal($param_name)),*]) }