Skip to content

Commit 053a5eb

Browse files
authored
Expect stable_features lint for stable SIMD types (#2584)
Previously, x86 AVX-12 SIMD types were gated by the unstable `stdarch_x86_avx512` feature. As of this writing, that feature has been stabilized on 1.89.0-nightly, staged for inclusion in 1.89.0 when it is released as stable. This means that the `simd-nightly` Cargo feature, which gates `stdarch_x86_avx512`, will now cause the `stable_features` lint to trigger when compiling on x86. This commit enables `expect(stable_features)` when compiling with `simd-nightly` for x86. Once 1.89.0 is released as stable, we will follow up with a commit which uses version detection to enable support for AVX-12 types, and we will remove our use of the `stdarch_x86_avx512` feature entirely. Makes progress on #2583 gherrit-pr-id: I7772b004a30ead788978e194181306fb98e092fa
1 parent 8fbfac9 commit 053a5eb

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ zerocopy-panic-in-const-and-vec-try-reserve-1-57-0 = "1.57.0"
6060
[package.metadata.ci]
6161
# The versions of the stable and nightly compiler toolchains to use in CI.
6262
pinned-stable = "1.87.0"
63-
pinned-nightly = "nightly-2025-06-07"
63+
pinned-nightly = "nightly-2025-06-09"
6464

6565
[package.metadata.docs.rs]
6666
all-features = true

src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,19 @@
303303
clippy::indexing_slicing,
304304
))]
305305
#![cfg_attr(not(any(test, kani, feature = "std")), no_std)]
306+
// NOTE: This attribute should have the effect of causing CI to fail if
307+
// `stdarch_x86_avx512` - which is currently stable in 1.89.0-nightly as of this
308+
// writing on 2025-06-10 - has its stabilization rolled back.
309+
//
310+
// FIXME(#2583): Remove once `stdarch_x86_avx512` is stabilized in 1.89.0, and
311+
// 1.89.0 has been released as stable.
312+
#![cfg_attr(
313+
all(feature = "simd-nightly", any(target_arch = "x86", target_arch = "x86_64")),
314+
expect(stable_features)
315+
)]
316+
// FIXME(#2583): Remove once `stdarch_x86_avx512` is stabilized in 1.89.0, and
317+
// 1.89.0 has been released as stable. Replace with version detection for 1.89.0
318+
// (see #2574 for a draft implementation).
306319
#![cfg_attr(
307320
all(feature = "simd-nightly", any(target_arch = "x86", target_arch = "x86_64")),
308321
feature(stdarch_x86_avx512)

0 commit comments

Comments
 (0)