This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 7373#![ feature( const_assert_type) ]
7474#![ feature( const_discriminant) ]
7575#![ feature( const_cell_into_inner) ]
76+ #![ feature( const_intrinsic_copy) ]
7677#![ feature( const_checked_int_methods) ]
7778#![ feature( const_euclidean_int_methods) ]
7879#![ feature( const_float_classify) ]
Original file line number Diff line number Diff line change @@ -685,7 +685,8 @@ pub unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
685685/// [valid]: self#safety
686686#[ inline]
687687#[ stable( feature = "rust1" , since = "1.0.0" ) ]
688- pub unsafe fn read < T > ( src : * const T ) -> T {
688+ #[ rustc_const_unstable( feature = "const_ptr_read" , issue = "none" ) ]
689+ pub const unsafe fn read < T > ( src : * const T ) -> T {
689690 // `copy_nonoverlapping` takes care of debug_assert.
690691 let mut tmp = MaybeUninit :: < T > :: uninit ( ) ;
691692 // SAFETY: the caller must guarantee that `src` is valid for reads.
@@ -784,7 +785,8 @@ pub unsafe fn read<T>(src: *const T) -> T {
784785/// ```
785786#[ inline]
786787#[ stable( feature = "ptr_unaligned" , since = "1.17.0" ) ]
787- pub unsafe fn read_unaligned < T > ( src : * const T ) -> T {
788+ #[ rustc_const_unstable( feature = "const_ptr_read" , issue = "none" ) ]
789+ pub const unsafe fn read_unaligned < T > ( src : * const T ) -> T {
788790 // `copy_nonoverlapping` takes care of debug_assert.
789791 let mut tmp = MaybeUninit :: < T > :: uninit ( ) ;
790792 // SAFETY: the caller must guarantee that `src` is valid for reads.
You can’t perform that action at this time.
0 commit comments