| 1 | [package] |
| 2 | name = "bytemuck" |
| 3 | description = "A crate for mucking around with piles of bytes." |
| 4 | version = "1.22.0" |
| 5 | authors = ["Lokathor <zefria@gmail.com>" ] |
| 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 | # MSRV 1.74.0 Pod/Zeroable implementations for `core::num::Saturating` |
| 62 | pod_saturating = [] |
| 63 | |
| 64 | # Enables all features that are both sound and supported on the latest stable |
| 65 | # version of Rust, with the exception of `extern_crate_alloc` and |
| 66 | # `extern_crate_std`. |
| 67 | # Note: Enabling this feature opts out of any MSRV guarantees! |
| 68 | latest_stable_rust = [ |
| 69 | # Keep this list sorted. |
| 70 | "aarch64_simd" , |
| 71 | "avx512_simd" , |
| 72 | "align_offset" , |
| 73 | "alloc_uninit" , |
| 74 | "const_zeroed" , |
| 75 | "derive" , |
| 76 | "min_const_generics" , |
| 77 | "must_cast" , |
| 78 | "must_cast_extra" , |
| 79 | "pod_saturating" , |
| 80 | "track_caller" , |
| 81 | "transparentwrapper_extra" , |
| 82 | "wasm_simd" , |
| 83 | "zeroable_atomics" , |
| 84 | "zeroable_maybe_uninit" , |
| 85 | ] |
| 86 | |
| 87 | # ALL FEATURES BELOW THIS ARE NOT SEMVER SUPPORTED! TEMPORARY ONLY! |
| 88 | |
| 89 | # Enable support for `std::simd` types. |
| 90 | nightly_portable_simd = [] |
| 91 | # Enable support for unstable `std::arch` types (such as the AVX512 types). |
| 92 | nightly_stdsimd = [] |
| 93 | # Enable `f16` and `f128` |
| 94 | nightly_float = [] |
| 95 | |
| 96 | # Improved documentation using the nightly toolchain |
| 97 | nightly_docs = [] |
| 98 | |
| 99 | [dependencies] |
| 100 | bytemuck_derive = { version = "1.4.1" , path = "derive" , optional = true } |
| 101 | |
| 102 | [lints.rust] |
| 103 | unexpected_cfgs = { level = "deny" , check-cfg = ['cfg(target_arch, values("spirv"))' ] } |
| 104 | |
| 105 | [package.metadata.docs.rs] |
| 106 | # Note(Lokathor): Don't use all-features or it would use `unsound_ptr_pod_impl` too. |
| 107 | features = [ |
| 108 | "nightly_docs" , |
| 109 | "latest_stable_rust" , |
| 110 | "extern_crate_alloc" , |
| 111 | "extern_crate_std" , |
| 112 | ] |
| 113 | |
| 114 | [package.metadata.playground] |
| 115 | # Note(Lokathor): Don't use all-features or it would use `unsound_ptr_pod_impl` too. |
| 116 | features = [ |
| 117 | "latest_stable_rust" , |
| 118 | "extern_crate_alloc" , |
| 119 | "extern_crate_std" , |
| 120 | ] |
| 121 | |