diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 9195da5a44f..2e1a667097c 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1004,7 +1004,7 @@ pub fn drop(_x: T) {} /// ``` #[inline] #[unstable(feature = "mem_copy_fn", issue = "98262")] -pub fn copy(x: &T) -> T { +pub const fn copy(x: &T) -> T { *x }