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:
commit
22e320b2c9
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue