We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45988ee commit db9a53bCopy full SHA for db9a53b
library/core/src/mem/mod.rs
@@ -933,7 +933,8 @@ pub fn drop<T>(_x: T) {}
933
/// ```
934
#[inline]
935
#[stable(feature = "rust1", since = "1.0.0")]
936
-pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
+#[rustc_const_unstable(feature = "const_transmute_copy", issue = "83165")]
937
+pub const unsafe fn transmute_copy<T, U>(src: &T) -> U {
938
// If U has a higher alignment requirement, src may not be suitably aligned.
939
if align_of::<U>() > align_of::<T>() {
940
// SAFETY: `src` is a reference which is guaranteed to be valid for reads.
0 commit comments