Rollup merge of #100006 - jyn514:update-copy, r=dtolnay

Make `core::mem::copy` const

cc https://github.com/rust-lang/rust/issues/98262, https://github.com/rust-lang/libs-team/issues/78
This commit is contained in:
Matthias Krüger 2022-10-30 00:09:23 +02:00 committed by GitHub
commit 22e320b2c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1004,7 +1004,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
}