Auto merge of #115520 - Finomnis:const_transmute_copy, r=dtolnay

Stabilize const_transmute_copy

Closes #83165
This commit is contained in:
bors 2023-09-16 01:51:55 +00:00
commit e81f85fe9e
2 changed files with 1 additions and 2 deletions

View File

@ -166,7 +166,6 @@
#![feature(const_slice_split_at_mut)] #![feature(const_slice_split_at_mut)]
#![feature(const_str_from_utf8_unchecked_mut)] #![feature(const_str_from_utf8_unchecked_mut)]
#![feature(const_swap)] #![feature(const_swap)]
#![feature(const_transmute_copy)]
#![feature(const_try)] #![feature(const_try)]
#![feature(const_type_id)] #![feature(const_type_id)]
#![feature(const_type_name)] #![feature(const_type_name)]

View File

@ -1051,7 +1051,7 @@ pub const fn copy<T: Copy>(x: &T) -> T {
#[inline] #[inline]
#[must_use] #[must_use]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_transmute_copy", issue = "83165")] #[rustc_const_stable(feature = "const_transmute_copy", since = "CURRENT_RUSTC_VERSION")]
pub const unsafe fn transmute_copy<Src, Dst>(src: &Src) -> Dst { pub const unsafe fn transmute_copy<Src, Dst>(src: &Src) -> Dst {
assert!( assert!(
size_of::<Src>() >= size_of::<Dst>(), size_of::<Src>() >= size_of::<Dst>(),