bytemuck
A crate for mucking around with piles of bytes.
1.25.2
340M downloads/mo
#329 most downloaded on crates.io
Lokathor/bytemuck
What this package is like to depend on
Last release 1 months ago
19 Jul 2026
Ships fairly regularly
a new release about every 2 months
Most releases are documented
notes for 25 of 38 stable releases
19 versions withdrawn
withdrawn after publishing
7 years old
58 releases · first in 2019
4 releases in the last 12 months
see the full history below
Release timeline
58 releases · Sep 2019 to Jul 2026Releases
latest 58-
1.25.219 Jul 2026 -
1.25.110 Jul 2026Release notes
Open source →- Don't impl core::error::Error on spirv, which was causing a build error on that target.
- Added a reminder on
try_cast_slicethat empty slices must still be aligned.
-
1.25.031 Jan 2026 -
1.24.003 Oct 2025 -
1.23.207 Aug 2025 -
1.23.108 Jun 2025 -
1.23.028 Apr 2025Nothing published for this version
-
1.22.003 Mar 2025Nothing published for this version
-
1.21.020 Dec 2024Nothing published for this version
-
1.20.019 Nov 2024Nothing published for this version
-
1.19.013 Oct 2024Nothing published for this version
-
1.18.006 Sep 2024Nothing published for this version
-
1.17.127 Aug 2024Release notes
Open source →- Adds
#[repr(C)]to theunion Transmute<A, B>type that's used internally for most of the transmutations.
- Adds
-
1.17.016 Aug 2024Release notes
Open source →- Makes the
must_castversions of the by-value and by-ref casts beconst. The mut ref cast is unaffected for now (mut references aren't yet stable inconst fn). This increases the MSRV of using that particular feature from 1.57 to 1.64.
- Makes the
-
1.16.330 Jul 2024Release notes
Open source →- Fully described in https://github.com/Lokathor/bytemuck/pull/256, This makes casting slices to/from ZST elements more consistent between the crate's core module and other modules.
-
1.16.230 Jul 2024Release notes
Open source →- Fixes potential UB where
BoxBytescould attempt to free a dangling pointer if theLayoutis zero sized. This type was introduced in 1.14.1, so that version and the others up to and including 1.16.1 are now yanked for safety.
- Fixes potential UB where
-
1.16.119 Jun 2024 withdrawnRelease notes
Open source →- NOT SEMVER SUPPORTED: Adds the
nightly_floatCargo feature. This activates thef16andf128nightly features, and then providesZeroableandPodimpls for those types.
- NOT SEMVER SUPPORTED: Adds the
-
1.16.013 May 2024 withdrawnRelease notes
Open source →- Adds a
const_zeroedfeature (MSRV 1.75) which puts azeroedfn at the crate root. This is just like theZeroable::zeroedmethod, but as aconst fn.
- Adds a
-
1.15.013 Mar 2024 withdrawnRelease notes
Open source →This primarily relaxes the bounds on a
Fromimpl.Previously:
impl<T: NoUninit> From<Box<T>> for BoxBytesNow:
impl<T: ?Sized + sealed::BoxBytesOf> From<Box<T>> for BoxBytesAll related functions and methods are similarly updated.
We believe this to be backwards compatible with all previous uses, and now
BoxBytescan be converted to/from more types than before. -
1.14.309 Feb 2024 withdrawnRelease notes
Open source →- The new std simd nightly features are apparently arch-specific. This adjusts the feature activation to be x86/ x86_64 only.
-
1.14.207 Feb 2024 withdrawnRelease notes
Open source →- Changes the name of the Nightly feature activated by the crate's
nightly_stdsimdfeature. This is needed as of (approximately) Nightly 2024-02-06 and later, because the Nightly feature was changed.
- Changes the name of the Nightly feature activated by the crate's
-
1.14.125 Jan 2024 withdrawn -
1.14.005 Sep 2023Nothing published for this version
-
1.13.128 Feb 2023Release notes
Open source →- Remove the requirement for the source data type to be
AnyBitPatternonpod_collect_to_vec, allowing you to pod collect vecs ofcharinto vecs ofu32, or whatever.
- Remove the requirement for the source data type to be
-
1.13.020 Jan 2023Nothing published for this version
-
1.12.419 Jan 2023 withdrawnRelease notes
Open source →- This has additional impls for existing traits and cleans up some internal code, but there's no new functions so I guess it counts as just a patch release.
-
1.12.305 Nov 2022Release notes
Open source →- This bugfix makes the crate do stuff with
Arcor not based on thetarget_has_atomicconfig. Previously, some targets that have allocation but not atomics were getting errors. This raises the MSRV of theextern_crate_allocfeature to 1.60, but opt-in features are not considered to be hard locked to 1.34 like the basic build of the crate is.
- This bugfix makes the crate do stuff with
-
1.12.230 Oct 2022Release notes
Open source →- Fixes
try_pod_read_unalignedbug that made it always fail unless the target type was exactly pointer sized in which case UB could happen. TheCheckedBitPattern::is_valid_bit_patternwas being asked to check that a reference to thepodvalue was a valid bit pattern, rather than the actual bit pattern itself, and so the check could in some cases be illegally bypassed.
- Fixes
-
1.12.117 Aug 2022Release notes
Open source →- Patch bumped the required
bytemuck_deriveversion because of a regression in how it handledalign(N)attributes.
- Patch bumped the required
-
1.12.014 Aug 2022 withdrawnNothing published for this version
-
1.11.024 Jul 2022Nothing published for this version
-
1.10.003 Jul 2022Nothing published for this version
-
1.9.102 Apr 2022Release notes
Open source →- Bumped the minimum
bytemuck_derivedependency version from1.0to1.1. The fact thatbytemuckandbytemuck_deriveare separate crates at all is an unfortunate technical limit of current Rust, woe and calamity.
- Bumped the minimum
-
1.9.030 Mar 2022Release notes
Open source →- fu5ha added the
NoUninit,AnyBitPattern, andCheckedBitPatterntraits. This allows for a more fine-grained level of detail in what casting operations are allowed for a type. Types that already implementZeroableandPodwill have a blanket impl for these new traits. This is a "preview" of the direction that the crate will probably go in the eventual 2.0 version. We're still waiting on Project Safe Transmute for an actual 2.0 version of the crate, but until then please enjoy this preview. - Also Fusha added better support for
uniontypes in the derive macros. I still don't know how any of the proc-macro stuff works at all, so please direct questions to her.
- fu5ha added the
-
1.8.002 Mar 2022Release notes
Open source →try_pod_read_unalignedandpod_read_unalignedlet you go from&[u8]toT:Podwithout worrying about alignment.
-
1.7.316 Dec 2021Release notes
Open source →- Experimental support for the
portable_simdlanguage extension under thenightly_portable_simdcargo feature. As the name implies, this is an experimental crate feature and it's not part of the semver contract. All it does is add the appropriateZeroableandPodimpls.
- Experimental support for the
-
1.7.223 Jul 2021Release notes
Open source →- Why does this repo keep being hit with publishing problems? What did I do to deserve this curse, Ferris? This doesn't ever happen with tinyvec or fermium, only bytemuck.
-
1.7.123 Jul 2021 withdrawnRelease notes
Open source →- Soundness Fix: The wrap/peel methods for owned value conversion, added to
TransparentWrapperin 1.6, can cause a double-drop if used with types that implDrop. The fix was simply to add aManuallyDroplayer around the value before doing thetransmute_copythat is used to wrap/peel. While this fix could technically be backported to the 1.6 series, since 1.7 is semver compatible anyway the 1.6 series has simply been yanked.
- Soundness Fix: The wrap/peel methods for owned value conversion, added to
-
1.7.013 Jun 2021 withdrawnNothing published for this version
-
1.6.313 Jun 2021 withdrawnRelease notes
Open source →- Small goof with an errant
;, so PR 69 actually got things working on SPIR-V.
- Small goof with an errant
-
1.6.213 Jun 2021 withdrawn -
1.6.112 Jun 2021 withdrawn -
1.6.010 Jun 2021 withdrawnNothing published for this version
-
1.5.118 Feb 2021 -
1.5.013 Jan 2021Nothing published for this version
-
1.4.108 Sep 2020Release notes
Open source → -
1.4.028 Aug 2020Nothing published for this version
-
1.3.125 Jul 2020Release notes
Open source →- The entire crate is now available under the
Apache-2.0 OR MITlicense as well as the previousZliblicense #24. - HeroicKatora added the
try_zeroed_slice_boxfunction #10.zeroed_slice_boxis also available. - The
offset_of!macro now supports a 2-arg version. For types that impl Default, it'll just make an instance usingdefaultand then call over to the 3-arg version. - The
PodCastErrortype now supportsHashandDisplay. Also if you enable theextern_crate_stdfeature then it will supportstd::error::Error. - We now provide a
TransparentWrapper<T>impl forcore::num::Wrapper<T>. - The error type of
try_from_bytesandtry_from_bytes_mutwhen the input isn't aligned has been corrected from beingAlignmentMismatch(intended for allocation casting only) toTargetAlignmentGreaterAndInputNotAligned.
- The entire crate is now available under the
-
1.3.025 Jul 2020 withdrawnRelease notes
Open source →- Had a bug because the CI was messed up! It wasn't soundness related, because
it prevented the crate from building entirely if the
extern_crate_allocfeature was used. Still, this is yanked, sorry.
- Had a bug because the CI was messed up! It wasn't soundness related, because
it prevented the crate from building entirely if the
-
1.3.0-alpha.024 Jul 2020 pre-release withdrawnNothing published for this version
-
1.2.007 Feb 2020Release notes
Open source →- thomcc added many things:
- A fully sound
offset_of!macro #10 - A
Contiguoustrait for when you've got enums with declared values all in a row #12 - A
TransparentWrappermarker trait for when you want to more clearly enable adding and removing a wrapper struct to its inner value #15 - Now MIRI is run on CI in every single push! #16
- A fully sound
- thomcc added many things:
-
1.2.0-alpha.129 Jan 2020 pre-releaseNothing published for this version
-
1.1.006 Dec 2019Release notes
Open source →- SimonSapin added
from_bytes,from_bytes_mut,try_from_bytes, andtry_from_bytes_mut(PR Link)
- SimonSapin added
-
1.0.126 Nov 2019Release notes
Open source →- Changed to the zlib license.
- Added much more proper documentation.
- Reduced the minimum Rust version to 1.34
-
1.0.019 Nov 2019Nothing published for this version
-
0.1.211 Nov 2019 withdrawnNothing published for this version
-
0.1.105 Nov 2019 withdrawnNothing published for this version
-
0.1.022 Sep 2019 withdrawnNothing published for this version