@@ -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
}
@@ -709,8 +711,9 @@ impl<T: ?Sized> *const T {
709
711
/// For non-`Sized` pointees this operation considers only the data pointers,
710
712
/// ignoring the metadata.
711
713
#[ inline( always) ]
712
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
713
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
714
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
715
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
716
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
714
717
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
715
718
pub const unsafe fn byte_offset_from < U : ?Sized > ( self , origin : * const U ) -> isize {
716
719
// SAFETY: the caller must uphold the safety contract for `offset_from`.
@@ -935,8 +938,9 @@ impl<T: ?Sized> *const T {
935
938
/// leaving the metadata untouched.
936
939
#[ must_use]
937
940
#[ inline( always) ]
938
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
939
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
941
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
942
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
943
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
940
944
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
941
945
pub const unsafe fn byte_add ( self , count : usize ) -> Self {
942
946
// SAFETY: the caller must uphold the safety contract for `add`.
@@ -1028,8 +1032,9 @@ impl<T: ?Sized> *const T {
1028
1032
/// leaving the metadata untouched.
1029
1033
#[ must_use]
1030
1034
#[ inline( always) ]
1031
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1032
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1035
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1036
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1037
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
1033
1038
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
1034
1039
pub const unsafe fn byte_sub ( self , count : usize ) -> Self {
1035
1040
// SAFETY: the caller must uphold the safety contract for `sub`.
@@ -1108,8 +1113,9 @@ impl<T: ?Sized> *const T {
1108
1113
/// leaving the metadata untouched.
1109
1114
#[ must_use]
1110
1115
#[ inline( always) ]
1111
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1112
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1116
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1117
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1118
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
1113
1119
pub const fn wrapping_byte_add ( self , count : usize ) -> Self {
1114
1120
self . cast :: < u8 > ( ) . wrapping_add ( count) . with_metadata_of ( self )
1115
1121
}
@@ -1186,8 +1192,9 @@ impl<T: ?Sized> *const T {
1186
1192
/// leaving the metadata untouched.
1187
1193
#[ must_use]
1188
1194
#[ inline( always) ]
1189
- #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
1190
- #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1195
+ #[ stable( feature = "pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1196
+ #[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "CURRENT_RUSTC_VERSION" ) ]
1197
+ #[ rustc_allow_const_fn_unstable( set_ptr_value) ]
1191
1198
pub const fn wrapping_byte_sub ( self , count : usize ) -> Self {
1192
1199
self . cast :: < u8 > ( ) . wrapping_sub ( count) . with_metadata_of ( self )
1193
1200
}
@@ -1355,7 +1362,6 @@ impl<T: ?Sized> *const T {
1355
1362
///
1356
1363
/// ```
1357
1364
/// #![feature(pointer_is_aligned)]
1358
- /// #![feature(pointer_byte_offsets)]
1359
1365
///
1360
1366
/// // On some platforms, the alignment of i32 is less than 4.
1361
1367
/// #[repr(align(4))]
@@ -1477,7 +1483,6 @@ impl<T: ?Sized> *const T {
1477
1483
///
1478
1484
/// ```
1479
1485
/// #![feature(pointer_is_aligned)]
1480
- /// #![feature(pointer_byte_offsets)]
1481
1486
///
1482
1487
/// // On some platforms, the alignment of i32 is less than 4.
1483
1488
/// #[repr(align(4))]
0 commit comments