about summary refs log tree commit diff
path: root/library/core
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-25 11:16:34 +0200
committerGitHub <noreply@github.com>2025-07-25 11:16:34 +0200
commite3b07352a61f23b5288a60649d5ac4d0a29c1246 (patch)
treebc37ac4b48ab194d752de7e3b9ce5ef3b0631285 /library/core
parentdd159ee24e06badc4289bb510f75949908d1a422 (diff)
parent05154af3e857f23b41072793e401a78a5aa952d9 (diff)
downloadrust-e3b07352a61f23b5288a60649d5ac4d0a29c1246.tar.gz
rust-e3b07352a61f23b5288a60649d5ac4d0a29c1246.zip
Rollup merge of #143970 - SunkenPotato:update_mem_copy_docs, r=scottmcm
Update core::mem::copy documentation

Update the documentation of `core::mem::copy` to include a `const` on the definition of the function.
Diffstat (limited to 'library/core')
-rw-r--r--library/core/src/mem/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index 2198d098c4b..33407637ab3 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -960,7 +960,7 @@ pub fn drop<T>(_x: T) {}
 ///
 /// This function is not magic; it is literally defined as
 /// ```
-/// pub fn copy<T: Copy>(x: &T) -> T { *x }
+/// pub const fn copy<T: Copy>(x: &T) -> T { *x }
 /// ```
 ///
 /// It is useful when you want to pass a function pointer to a combinator, rather than defining a new closure.