Auto merge of #115520 - Finomnis:const_transmute_copy, r=dtolnay
Stabilize const_transmute_copy Closes #83165
This commit is contained in:
commit
e81f85fe9e
@ -166,7 +166,6 @@
|
||||
#![feature(const_slice_split_at_mut)]
|
||||
#![feature(const_str_from_utf8_unchecked_mut)]
|
||||
#![feature(const_swap)]
|
||||
#![feature(const_transmute_copy)]
|
||||
#![feature(const_try)]
|
||||
#![feature(const_type_id)]
|
||||
#![feature(const_type_name)]
|
||||
|
@ -1051,7 +1051,7 @@ pub const fn copy<T: Copy>(x: &T) -> T {
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[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 {
|
||||
assert!(
|
||||
size_of::<Src>() >= size_of::<Dst>(),
|
||||
|
Loading…
Reference in New Issue
Block a user