about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/mem/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index a02c400557b..37e8d65db6a 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -933,7 +933,8 @@ pub fn drop<T>(_x: T) {}
 /// ```
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
-pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
+#[rustc_const_unstable(feature = "const_transmute_copy", issue = "83165")]
+pub const unsafe fn transmute_copy<T, U>(src: &T) -> U {
     // If U has a higher alignment requirement, src may not be suitably aligned.
     if align_of::<U>() > align_of::<T>() {
         // SAFETY: `src` is a reference which is guaranteed to be valid for reads.