Skip to content

Commit b7339dc

Browse files
committed
attempt to fix wasm const fn
1 parent 0669fa8 commit b7339dc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/core_arch/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
sha512_sm_x86,
3838
x86_amx_intrinsics,
3939
f16,
40-
rustc_allow_const_fn_unstable
40+
rustc_allow_const_fn_unstable,
41+
wasm_simd_const_internals
4142
)]
4243
#![cfg_attr(test, feature(test, abi_vectorcall, stdarch_internal))]
4344
#![deny(clippy::missing_inline_in_public_items)]
@@ -73,10 +74,6 @@
7374
stdarch_loongarch_feature_detection
7475
)
7576
)]
76-
#![cfg_attr(
77-
any(target_arch = "wasm32", target_arch = "wasm64", doc),
78-
feature(wasm_simd_const_internals)
79-
)]
8077

8178
#[cfg(test)]
8279
#[macro_use]

crates/core_arch/src/simd.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ macro_rules! simd_ty {
1111
#[allow(clippy::use_self)]
1212
impl $id {
1313
#[inline(always)]
14+
#[rustc_const_unstable(feature = "wasm_simd_const_internals", issue = "none")] // FIXME remove when const-stability v2 migration is done
1415
pub(crate) const fn new($($param_name: $elem_type),*) -> Self {
1516
$id([$($param_name),*])
1617
}
@@ -52,11 +53,13 @@ macro_rules! simd_m_ty {
5253
#[allow(clippy::use_self)]
5354
impl $id {
5455
#[inline(always)]
56+
#[rustc_const_unstable(feature = "wasm_simd_const_internals", issue = "none")] // FIXME remove when const-stability v2 migration is done
5557
const fn bool_to_internal(x: bool) -> $elem_type {
5658
[0 as $elem_type, !(0 as $elem_type)][x as usize]
5759
}
5860

5961
#[inline(always)]
62+
#[rustc_const_unstable(feature = "wasm_simd_const_internals", issue = "none")] // FIXME remove when const-stability v2 migration is done
6063
pub(crate) const fn new($($param_name: bool),*) -> Self {
6164
$id([$(Self::bool_to_internal($param_name)),*])
6265
}

0 commit comments

Comments
 (0)