diff options
| author | Joshua Nelson <jnelson@cloudflare.com> | 2022-07-31 19:14:03 -0500 |
|---|---|---|
| committer | Joshua Nelson <jnelson@cloudflare.com> | 2022-09-14 18:50:33 -0500 |
| commit | b5d5682ac30615b35bd2f011c24a3c927420c87f (patch) | |
| tree | 6eceae9ed63a3cd235aa22f609f7d931a8732b34 | |
| parent | 88a192257ce110e7fb1732aa2b65e481f811db7a (diff) | |
| download | rust-b5d5682ac30615b35bd2f011c24a3c927420c87f.tar.gz rust-b5d5682ac30615b35bd2f011c24a3c927420c87f.zip | |
Make `core::mem::copy` const
| -rw-r--r-- | library/core/src/mem/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index d2dd2941d59..ee29a233efe 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -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 } |
