Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ latest_stable_rust = [
# ALL FEATURES BELOW THIS ARE NOT SEMVER SUPPORTED! TEMPORARY ONLY!

# Enable support for `std::simd` types.
nightly_portable_simd = []
nightly_portable_simd = ["rustversion"]
# Enable support for unstable `std::arch` types (such as the AVX512 types).
nightly_stdsimd = []
# Enable `f16` and `f128`
Expand All @@ -108,6 +108,7 @@ nightly_docs = []

[dependencies]
bytemuck_derive = { version = "1.10.2", path = "derive", optional = true }
rustversion = { version = "1.0.22", optional = true }

[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = [
Expand Down
13 changes: 13 additions & 0 deletions src/pod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ impl_unsafe_marker_for_simd!(
}
);

#[rustversion::before(2026-01-27)] // See https://github.com/Lokathor/bytemuck/issues/343
#[cfg(feature = "nightly_portable_simd")]
#[cfg_attr(
feature = "nightly_docs",
Expand All @@ -155,6 +156,18 @@ where
{
}

#[rustversion::since(2026-01-27)] // See https://github.com/Lokathor/bytemuck/issues/343
#[cfg(feature = "nightly_portable_simd")]
#[cfg_attr(
feature = "nightly_docs",
doc(cfg(feature = "nightly_portable_simd"))
)]
unsafe impl<T, const N: usize> Pod for core::simd::Simd<T, N>
where
T: core::simd::SimdElement + Pod,
{
}

impl_unsafe_marker_for_simd!(
#[cfg(all(target_arch = "x86", feature = "avx512_simd"))]
unsafe impl Pod for x86::{
Expand Down
13 changes: 13 additions & 0 deletions src/zeroable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ impl_unsafe_marker_for_simd!(
}
);

#[rustversion::before(2026-01-27)] // See https://github.com/Lokathor/bytemuck/issues/343
#[cfg(feature = "nightly_portable_simd")]
#[cfg_attr(
feature = "nightly_docs",
Expand All @@ -234,6 +235,18 @@ where
{
}

#[rustversion::since(2026-01-27)] // See https://github.com/Lokathor/bytemuck/issues/343
#[cfg(feature = "nightly_portable_simd")]
#[cfg_attr(
feature = "nightly_docs",
doc(cfg(feature = "nightly_portable_simd"))
)]
unsafe impl<T, const N: usize> Zeroable for core::simd::Simd<T, N>
where
T: core::simd::SimdElement + Zeroable,
{
}

impl_unsafe_marker_for_simd!(
#[cfg(all(target_arch = "x86", feature = "avx512_simd"))]
unsafe impl Zeroable for x86::{
Expand Down