| 1 |
[package] |
| 2 |
name = "bytemuck" |
| 3 |
description = "A crate for mucking around with piles of bytes." |
| 4 |
version = "1.21.0" |
| 5 |
authors = ["Lokathor <[email protected]>"] |
| 6 |
repository = "https://github.com/Lokathor/bytemuck" |
| 7 |
readme = "README.md" |
| 8 |
keywords = ["transmute", "bytes", "casting"] |
| 9 |
categories = ["encoding", "no-std"] |
| 10 |
edition = "2018" |
| 11 |
license = "Zlib OR Apache-2.0 OR MIT" |
| 12 |
exclude = ["/pedantic.bat"] |
| 13 |
|
| 14 |
[features] |
| 15 |
# In v2 we'll fix these names to be more "normal". |
| 16 |
|
| 17 |
# Enable deriving the various `bytemuck` traits. |
| 18 |
derive = ["bytemuck_derive"] |
| 19 |
# Enable features requiring items from `extern crate alloc`. |
| 20 |
extern_crate_alloc = [] |
| 21 |
# Enable features requiring items from `extern crate std`. |
| 22 |
extern_crate_std = ["extern_crate_alloc"] |
| 23 |
# Implement `Zeroable` for `MaybeUninit`. |
| 24 |
zeroable_maybe_uninit = [] |
| 25 |
# Implement `Zeroable` for `std::sync::atomic` types. |
| 26 |
zeroable_atomics = [] |
| 27 |
|
| 28 |
# All MSRV notes below are GUIDELINES and future versions may require even more |
| 29 |
# MSRV on any feature. |
| 30 |
|
| 31 |
# MSRV 1.36: Use `align_offset` method instead of casting to `usize` to check |
| 32 |
# alignment of pointers, this *may* improve codegen in some cases (but it has |
| 33 |
# never been formally benchmarked!) |
| 34 |
align_offset = [] |
| 35 |
|
| 36 |
min_const_generics = [] # MSRV 1.51: support arrays via min_const_generics |
| 37 |
|
| 38 |
wasm_simd = [] # MSRV 1.54.0: support wasm simd types |
| 39 |
aarch64_simd = [] # MSRV 1.59.0: support aarch64 simd types |
| 40 |
avx512_simd = [] # MSRV 1.72.0: support avx512 simd types |
| 41 |
|
| 42 |
must_cast = [] # MSRV 1.64.0: support the `must` module. |
| 43 |
must_cast_extra = ["must_cast"] # MSRV 1.83.0: support mutable references in const |
| 44 |
|
| 45 |
# Adds `TransparentWrapper` impls for stdlib types newer than bytemuck's base MSRV. |
| 46 |
# Current MSRV 1.74.0: `core::num::Saturating`. |
| 47 |
# MSRV may increase if impls are added for newer types. |
| 48 |
transparentwrapper_extra = [] |
| 49 |
|
| 50 |
const_zeroed = [] # MSRV 1.75.0: support const `zeroed()` |
| 51 |
|
| 52 |
# MSRV 1.82.0: support `zeroed_*rc*` when combined with `extern_crate_alloc` |
| 53 |
alloc_uninit = [] |
| 54 |
|
| 55 |
# Do not use if you can avoid it, because this is **unsound**!!!! |
| 56 |
unsound_ptr_pod_impl = [] |
| 57 |
|
| 58 |
# MSRV 1.46.0: adds the `#[track_caller]` attribute to functions which may panic |
| 59 |
track_caller = [] |
| 60 |
|
| 61 |
# Enables all features that are both sound and supported on the latest stable |
| 62 |
# version of Rust, with the exception of `extern_crate_alloc` and |
| 63 |
# `extern_crate_std`. |
| 64 |
# Note: Enabling this feature opts out of any MSRV guarantees! |
| 65 |
latest_stable_rust = [ |
| 66 |
# Keep this list sorted. |
| 67 |
"aarch64_simd", |
| 68 |
"avx512_simd", |
| 69 |
"align_offset", |
| 70 |
"alloc_uninit", |
| 71 |
"const_zeroed", |
| 72 |
"derive", |
| 73 |
"min_const_generics", |
| 74 |
"must_cast", |
| 75 |
"must_cast_extra", |
| 76 |
"track_caller", |
| 77 |
"transparentwrapper_extra", |
| 78 |
"wasm_simd", |
| 79 |
"zeroable_atomics", |
| 80 |
"zeroable_maybe_uninit", |
| 81 |
] |
| 82 |
|
| 83 |
# ALL FEATURES BELOW THIS ARE NOT SEMVER SUPPORTED! TEMPORARY ONLY! |
| 84 |
|
| 85 |
# Enable support for `std::simd` types. |
| 86 |
nightly_portable_simd = [] |
| 87 |
# Enable support for unstable `std::arch` types (such as the AVX512 types). |
| 88 |
nightly_stdsimd = [] |
| 89 |
# Enable `f16` and `f128` |
| 90 |
nightly_float = [] |
| 91 |
|
| 92 |
# Improved documentation using the nightly toolchain |
| 93 |
nightly_docs = [] |
| 94 |
|
| 95 |
[dependencies] |
| 96 |
bytemuck_derive = { version = "1.4", path = "derive", optional = true } |
| 97 |
|
| 98 |
[lints.rust] |
| 99 |
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(target_arch, values("spirv"))'] } |
| 100 |
|
| 101 |
[package.metadata.docs.rs] |
| 102 |
# Note(Lokathor): Don't use all-features or it would use `unsound_ptr_pod_impl` too. |
| 103 |
features = [ |
| 104 |
"nightly_docs", |
| 105 |
"latest_stable_rust", |
| 106 |
"extern_crate_alloc", |
| 107 |
"extern_crate_std", |
| 108 |
] |
| 109 |
|
| 110 |
[package.metadata.playground] |
| 111 |
# Note(Lokathor): Don't use all-features or it would use `unsound_ptr_pod_impl` too. |
| 112 |
features = [ |
| 113 |
"latest_stable_rust", |
| 114 |
"extern_crate_alloc", |
| 115 |
"extern_crate_std", |
| 116 |
] |