@@ -430,7 +430,8 @@ pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
430430}
431431
432432#[ inline]
433- pub ( crate ) unsafe fn swap_nonoverlapping_one < T > ( x : * mut T , y : * mut T ) {
433+ #[ rustc_const_unstable( feature = "const_swap" , issue = "83163" ) ]
434+ pub ( crate ) const unsafe fn swap_nonoverlapping_one < T > ( x : * mut T , y : * mut T ) {
434435 // NOTE(eddyb) SPIR-V's Logical addressing model doesn't allow for arbitrary
435436 // reinterpretation of values as (chunkable) byte arrays, and the loop in the
436437 // block optimization in `swap_nonoverlapping_bytes` is hard to rewrite back
@@ -563,7 +564,8 @@ const unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
563564/// ```
564565#[ inline]
565566#[ stable( feature = "rust1" , since = "1.0.0" ) ]
566- pub unsafe fn replace < T > ( dst : * mut T , mut src : T ) -> T {
567+ #[ rustc_const_unstable( feature = "const_replace" , issue = "83164" ) ]
568+ pub const unsafe fn replace < T > ( dst : * mut T , mut src : T ) -> T {
567569 // SAFETY: the caller must guarantee that `dst` is valid to be
568570 // cast to a mutable reference (valid for writes, aligned, initialized),
569571 // and cannot overlap `src` since `dst` must point to a distinct
@@ -869,10 +871,12 @@ pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
869871/// ```
870872#[ inline]
871873#[ stable( feature = "rust1" , since = "1.0.0" ) ]
872- pub unsafe fn write < T > ( dst : * mut T , src : T ) {
874+ #[ rustc_const_unstable( feature = "const_ptr_write" , issue = "none" ) ]
875+ pub const unsafe fn write < T > ( dst : * mut T , src : T ) {
873876 // We are calling the intrinsics directly to avoid function calls in the generated code
874877 // as `intrinsics::copy_nonoverlapping` is a wrapper function.
875878 extern "rust-intrinsic" {
879+ #[ rustc_const_unstable( feature = "const_intrinsic_copy" , issue = "none" ) ]
876880 fn copy_nonoverlapping < T > ( src : * const T , dst : * mut T , count : usize ) ;
877881 }
878882
0 commit comments