Cargo Features

bytemuck has no features set by default.

[dependencies]
bytemuck = { version = "1.18.0", features = ["derive", "extern_crate_alloc", "extern_crate_std", "zeroable_atomics", "align_offset", "min_const_generics", "wasm_simd", "aarch64_simd", "must_cast", "const_zeroed", "unsound_ptr_pod_impl", "latest_stable_rust", "nightly_portable_simd", "nightly_stdsimd", "nightly_float", "nightly_docs"] }
derive latest_stable_rust? = bytemuck_derive

In v2 we'll fix these names to be more "normal".

extern_crate_alloc extern_crate_std?

Affects bytemuck::allocation

extern_crate_std = extern_crate_alloc
zeroable_maybe_uninit zeroable_atomics latest_stable_rust?
align_offset latest_stable_rust?

All MSRV notes below are GUIDELINES and future versions may require even more MSRV on any feature.

MSRV 1.36: Use align_offset method instead of casting to usize to check alignment of pointers, this may improve codegen in some cases (but it has never been formally benchmarked!)

min_const_generics latest_stable_rust?

MSRV 1.51: support arrays via min_const_generics

wasm_simd latest_stable_rust?

MSRV 1.54.0: support wasm simd types

aarch64_simd latest_stable_rust?

MSRV 1.59.0: support aarch64 simd types

must_cast latest_stable_rust?

MSRV 1.64.0: support the must module.

const_zeroed latest_stable_rust?

MSRV 1.75.0: support const zeroed()

Affects bytemuck::zeroed

unsound_ptr_pod_impl

Do not use if you can avoid it, because this is **unsound**!!!!

latest_stable_rust = aarch64_simd, align_offset, const_zeroed, derive, min_const_generics, must_cast, wasm_simd, zeroable_atomics, zeroable_maybe_uninit

Enables all features that are both sound and supported on the latest stable version of Rust, with the exception of extern_crate_alloc and extern_crate_std. Note: Enabling this feature opts out of any MSRV guarantees!

nightly_portable_simd

NOT SEMVER SUPPORTED! TEMPORARY ONLY!

nightly_stdsimd
nightly_float

Enable f16 and f128

nightly_docs

Improved documentation using the nightly toolchain

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

bytemuck_derive derive?