Stabilize const_fn_transmute
This commit is contained in:
@@ -2096,7 +2096,7 @@ macro_rules! int_impl {
|
||||
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
|
||||
// SAFETY: const sound because integers are plain old datatypes so we can always
|
||||
// transmute them to arrays of bytes
|
||||
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
|
||||
#[inline]
|
||||
pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
|
||||
// SAFETY: integers are plain old datatypes so we can always transmute them to
|
||||
@@ -2202,7 +2202,7 @@ macro_rules! int_impl {
|
||||
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
|
||||
// SAFETY: const sound because integers are plain old datatypes so we can always
|
||||
// transmute to them
|
||||
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
|
||||
#[inline]
|
||||
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
|
||||
// SAFETY: integers are plain old datatypes so we can always transmute to them
|
||||
|
||||
Reference in New Issue
Block a user