@@ -470,8 +470,9 @@ impl<T: ?Sized> *const T {
470
470
/// leaving the metadata untouched.
471
471
#[ must_use]
472
472
#[ inline( always) ]
473
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
474
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
473
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
474
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
475
+ #[ rustc_allow_const_fn_unstable( ptr_metadata) ]
475
476
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
476
477
pub const unsafe fn byte_offset ( self , count : isize ) -> Self {
477
478
// SAFETY: the caller must uphold the safety contract for `offset`.
@@ -553,8 +554,9 @@ impl<T: ?Sized> *const T {
553
554
/// leaving the metadata untouched.
554
555
#[ must_use]
555
556
#[ inline( always) ]
556
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
557
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
557
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
558
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
559
+ #[ rustc_allow_const_fn_unstable( ptr_metadata) ]
558
560
pub const fn wrapping_byte_offset ( self , count : isize ) -> Self {
559
561
from_raw_parts :: < T > ( self . cast :: < u8 > ( ) . wrapping_offset ( count) . cast :: < ( ) > ( ) , metadata ( self ) )
560
562
}
@@ -679,8 +681,9 @@ impl<T: ?Sized> *const T {
679
681
/// For non-`Sized` pointees this operation considers only the data pointers,
680
682
/// ignoring the metadata.
681
683
#[ inline( always) ]
682
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
683
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
684
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
685
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
686
+ #[ rustc_allow_const_fn_unstable( ptr_metadata) ]
684
687
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
685
688
pub const unsafe fn byte_offset_from ( self , origin : * const T ) -> isize {
686
689
// SAFETY: the caller must uphold the safety contract for `offset_from`.
@@ -903,8 +906,9 @@ impl<T: ?Sized> *const T {
903
906
/// leaving the metadata untouched.
904
907
#[ must_use]
905
908
#[ inline( always) ]
906
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
907
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
909
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
910
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
911
+ #[ rustc_allow_const_fn_unstable( ptr_metadata) ]
908
912
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
909
913
pub const unsafe fn byte_add ( self , count : usize ) -> Self {
910
914
// SAFETY: the caller must uphold the safety contract for `add`.
@@ -990,8 +994,9 @@ impl<T: ?Sized> *const T {
990
994
/// leaving the metadata untouched.
991
995
#[ must_use]
992
996
#[ inline( always) ]
993
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
994
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
997
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
998
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
999
+ #[ rustc_allow_const_fn_unstable( ptr_metadata) ]
995
1000
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
996
1001
pub const unsafe fn byte_sub ( self , count : usize ) -> Self {
997
1002
// SAFETY: the caller must uphold the safety contract for `sub`.
@@ -1073,8 +1078,9 @@ impl<T: ?Sized> *const T {
1073
1078
/// leaving the metadata untouched.
1074
1079
#[ must_use]
1075
1080
#[ inline( always) ]
1076
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1077
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1081
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1082
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1083
+ #[ rustc_allow_const_fn_unstable( ptr_metadata) ]
1078
1084
pub const fn wrapping_byte_add ( self , count : usize ) -> Self {
1079
1085
from_raw_parts :: < T > ( self . cast :: < u8 > ( ) . wrapping_add ( count) . cast :: < ( ) > ( ) , metadata ( self ) )
1080
1086
}
@@ -1153,8 +1159,9 @@ impl<T: ?Sized> *const T {
1153
1159
/// leaving the metadata untouched.
1154
1160
#[ must_use]
1155
1161
#[ inline( always) ]
1156
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1157
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1162
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1163
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1164
+ #[ rustc_allow_const_fn_unstable( ptr_metadata) ]
1158
1165
pub const fn wrapping_byte_sub ( self , count : usize ) -> Self {
1159
1166
from_raw_parts :: < T > ( self . cast :: < u8 > ( ) . wrapping_sub ( count) . cast :: < ( ) > ( ) , metadata ( self ) )
1160
1167
}
0 commit comments