@@ -480,8 +480,9 @@ impl<T: ?Sized> *const T {
480
480
/// leaving the metadata untouched.
481
481
#[ must_use]
482
482
#[ inline( always) ]
483
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
484
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
483
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
484
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
485
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
485
486
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
486
487
pub const unsafe fn byte_offset ( self , count : isize ) -> Self {
487
488
// SAFETY: the caller must uphold the safety contract for `offset`.
@@ -560,8 +561,9 @@ impl<T: ?Sized> *const T {
560
561
/// leaving the metadata untouched.
561
562
#[ must_use]
562
563
#[ inline( always) ]
563
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
564
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
564
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
565
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
566
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
565
567
pub const fn wrapping_byte_offset ( self , count : isize ) -> Self {
566
568
self . cast :: < u8 > ( ) . wrapping_offset ( count) . with_metadata_of ( self )
567
569
}
@@ -726,8 +728,9 @@ impl<T: ?Sized> *const T {
726
728
/// For non-`Sized` pointees this operation considers only the data pointers,
727
729
/// ignoring the metadata.
728
730
#[ inline( always) ]
729
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
730
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
731
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
732
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
733
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
731
734
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
732
735
pub const unsafe fn byte_offset_from < U : ?Sized > ( self , origin : * const U ) -> isize {
733
736
// SAFETY: the caller must uphold the safety contract for `offset_from`.
@@ -952,8 +955,9 @@ impl<T: ?Sized> *const T {
952
955
/// leaving the metadata untouched.
953
956
#[ must_use]
954
957
#[ inline( always) ]
955
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
956
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
958
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
959
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
960
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
957
961
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
958
962
pub const unsafe fn byte_add ( self , count : usize ) -> Self {
959
963
// SAFETY: the caller must uphold the safety contract for `add`.
@@ -1045,8 +1049,9 @@ impl<T: ?Sized> *const T {
1045
1049
/// leaving the metadata untouched.
1046
1050
#[ must_use]
1047
1051
#[ inline( always) ]
1048
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1049
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1052
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1053
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1054
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
1050
1055
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
1051
1056
pub const unsafe fn byte_sub ( self , count : usize ) -> Self {
1052
1057
// SAFETY: the caller must uphold the safety contract for `sub`.
@@ -1125,8 +1130,9 @@ impl<T: ?Sized> *const T {
1125
1130
/// leaving the metadata untouched.
1126
1131
#[ must_use]
1127
1132
#[ inline( always) ]
1128
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1129
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1133
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1134
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1135
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
1130
1136
pub const fn wrapping_byte_add ( self , count : usize ) -> Self {
1131
1137
self . cast :: < u8 > ( ) . wrapping_add ( count) . with_metadata_of ( self )
1132
1138
}
@@ -1203,8 +1209,9 @@ impl<T: ?Sized> *const T {
1203
1209
/// leaving the metadata untouched.
1204
1210
#[ must_use]
1205
1211
#[ inline( always) ]
1206
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1207
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1212
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1213
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1214
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
1208
1215
pub const fn wrapping_byte_sub ( self , count : usize ) -> Self {
1209
1216
self . cast :: < u8 > ( ) . wrapping_sub ( count) . with_metadata_of ( self )
1210
1217
}
@@ -1372,7 +1379,6 @@ impl<T: ?Sized> *const T {
1372
1379
///
1373
1380
/// ```
1374
1381
/// #![feature(pointer_is_aligned)]
1375
- /// #![feature(pointer_byte_offsets)]
1376
1382
///
1377
1383
/// // On some platforms, the alignment of i32 is less than 4.
1378
1384
/// #[repr(align(4))]
@@ -1494,7 +1500,6 @@ impl<T: ?Sized> *const T {
1494
1500
///
1495
1501
/// ```
1496
1502
/// #![feature(pointer_is_aligned)]
1497
- /// #![feature(pointer_byte_offsets)]
1498
1503
///
1499
1504
/// // On some platforms, the alignment of i32 is less than 4.
1500
1505
/// #[repr(align(4))]
0 commit comments