mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-21 22:32:23 +00:00
Support Zeroable
and Pod
for f16
and f128
(#251)
These are gated under a new feature flag `nightly_float`. Fixes: <https://github.com/Lokathor/bytemuck/issues/250>
This commit is contained in:
parent
d15b8e0e6d
commit
9b81537c5f
@ -42,6 +42,8 @@ unsound_ptr_pod_impl = []
|
|||||||
# NOT SEMVER SUPPORTED! TEMPORARY ONLY!
|
# NOT SEMVER SUPPORTED! TEMPORARY ONLY!
|
||||||
nightly_portable_simd = []
|
nightly_portable_simd = []
|
||||||
nightly_stdsimd = []
|
nightly_stdsimd = []
|
||||||
|
# Enable `f16` and `f128`
|
||||||
|
nightly_float = []
|
||||||
|
|
||||||
# Improved documentation using the nightly toolchain
|
# Improved documentation using the nightly toolchain
|
||||||
nightly_docs = []
|
nightly_docs = []
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#![allow(clippy::type_complexity)]
|
#![allow(clippy::type_complexity)]
|
||||||
#![cfg_attr(feature = "nightly_docs", feature(doc_cfg))]
|
#![cfg_attr(feature = "nightly_docs", feature(doc_cfg))]
|
||||||
#![cfg_attr(feature = "nightly_portable_simd", feature(portable_simd))]
|
#![cfg_attr(feature = "nightly_portable_simd", feature(portable_simd))]
|
||||||
|
#![cfg_attr(feature = "nightly_float", feature(f16, f128))]
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
all(
|
all(
|
||||||
feature = "nightly_stdsimd",
|
feature = "nightly_stdsimd",
|
||||||
|
@ -49,8 +49,12 @@ unsafe impl Pod for usize {}
|
|||||||
unsafe impl Pod for isize {}
|
unsafe impl Pod for isize {}
|
||||||
unsafe impl Pod for u128 {}
|
unsafe impl Pod for u128 {}
|
||||||
unsafe impl Pod for i128 {}
|
unsafe impl Pod for i128 {}
|
||||||
|
#[cfg(feature = "nightly_float")]
|
||||||
|
unsafe impl Pod for f16 {}
|
||||||
unsafe impl Pod for f32 {}
|
unsafe impl Pod for f32 {}
|
||||||
unsafe impl Pod for f64 {}
|
unsafe impl Pod for f64 {}
|
||||||
|
#[cfg(feature = "nightly_float")]
|
||||||
|
unsafe impl Pod for f128 {}
|
||||||
unsafe impl<T: Pod> Pod for Wrapping<T> {}
|
unsafe impl<T: Pod> Pod for Wrapping<T> {}
|
||||||
|
|
||||||
#[cfg(feature = "unsound_ptr_pod_impl")]
|
#[cfg(feature = "unsound_ptr_pod_impl")]
|
||||||
|
@ -48,8 +48,12 @@ unsafe impl Zeroable for usize {}
|
|||||||
unsafe impl Zeroable for isize {}
|
unsafe impl Zeroable for isize {}
|
||||||
unsafe impl Zeroable for u128 {}
|
unsafe impl Zeroable for u128 {}
|
||||||
unsafe impl Zeroable for i128 {}
|
unsafe impl Zeroable for i128 {}
|
||||||
|
#[cfg(feature = "nightly_float")]
|
||||||
|
unsafe impl Zeroable for f16 {}
|
||||||
unsafe impl Zeroable for f32 {}
|
unsafe impl Zeroable for f32 {}
|
||||||
unsafe impl Zeroable for f64 {}
|
unsafe impl Zeroable for f64 {}
|
||||||
|
#[cfg(feature = "nightly_float")]
|
||||||
|
unsafe impl Zeroable for f128 {}
|
||||||
unsafe impl<T: Zeroable> Zeroable for Wrapping<T> {}
|
unsafe impl<T: Zeroable> Zeroable for Wrapping<T> {}
|
||||||
unsafe impl<T: Zeroable> Zeroable for core::cmp::Reverse<T> {}
|
unsafe impl<T: Zeroable> Zeroable for core::cmp::Reverse<T> {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user