Make core::mem::copy const

This commit is contained in:
Joshua Nelson 2022-07-31 19:14:03 -05:00
parent 88a192257c
commit b5d5682ac3

View File

@ -1005,7 +1005,7 @@ pub fn drop<T>(_x: T) {}
/// ```
#[inline]
#[unstable(feature = "mem_copy_fn", issue = "98262")]
pub fn copy<T: Copy>(x: &T) -> T {
pub const fn copy<T: Copy>(x: &T) -> T {
*x
}