File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 73
73
#![ feature( const_assert_type) ]
74
74
#![ feature( const_discriminant) ]
75
75
#![ feature( const_cell_into_inner) ]
76
+ #![ feature( const_intrinsic_copy) ]
76
77
#![ feature( const_checked_int_methods) ]
77
78
#![ feature( const_euclidean_int_methods) ]
78
79
#![ 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 {
685
685
/// [valid]: self#safety
686
686
#[ inline]
687
687
#[ 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 {
689
690
// `copy_nonoverlapping` takes care of debug_assert.
690
691
let mut tmp = MaybeUninit :: < T > :: uninit ( ) ;
691
692
// SAFETY: the caller must guarantee that `src` is valid for reads.
@@ -784,7 +785,8 @@ pub unsafe fn read<T>(src: *const T) -> T {
784
785
/// ```
785
786
#[ inline]
786
787
#[ 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 {
788
790
// `copy_nonoverlapping` takes care of debug_assert.
789
791
let mut tmp = MaybeUninit :: < T > :: uninit ( ) ;
790
792
// SAFETY: the caller must guarantee that `src` is valid for reads.
You can’t perform that action at this time.
0 commit comments