mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-21 22:32:23 +00:00
put const_zeroed into the changelog
This commit is contained in:
parent
9319f4858b
commit
a41510f303
@ -1,5 +1,10 @@
|
||||
# `bytemuck` changelog
|
||||
|
||||
## 1.16.0 (UNRELEASED)
|
||||
|
||||
* Adds a `const_zeroed` feature (MSRV 1.75) which puts a `zeroed` fn at the crate root.
|
||||
This is just like the `Zeroable::zeroed` method, but as a `const fn`.
|
||||
|
||||
## 1.15.0
|
||||
|
||||
This primarily relaxes the bounds on a `From` impl.
|
||||
|
@ -514,11 +514,10 @@ pub fn fill_zeroes<T: Zeroable>(slice: &mut [T]) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Initialize a zeroed `T`.
|
||||
///
|
||||
/// Like [`Zeroable::zeroed`], but supports const.
|
||||
/// Same as [`Zeroable::zeroed`], but as a `const fn` const.
|
||||
#[cfg(feature = "const_zeroed")]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub const fn zeroed<T: Zeroable>() -> T {
|
||||
unsafe { core::mem::zeroed() }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user