@@ -151,8 +151,9 @@ impl<T: ?Sized> *const T {
151
151
/// ```
152
152
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
153
153
#[ must_use = "returns a new pointer rather than modifying its argument" ]
154
+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
154
155
#[ inline]
155
- pub unsafe fn offset ( self , count : isize ) -> * const T
156
+ pub const unsafe fn offset ( self , count : isize ) -> * const T
156
157
where
157
158
T : Sized ,
158
159
{
@@ -210,8 +211,9 @@ impl<T: ?Sized> *const T {
210
211
/// ```
211
212
#[ stable( feature = "ptr_wrapping_offset" , since = "1.16.0" ) ]
212
213
#[ must_use = "returns a new pointer rather than modifying its argument" ]
214
+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
213
215
#[ inline]
214
- pub fn wrapping_offset ( self , count : isize ) -> * const T
216
+ pub const fn wrapping_offset ( self , count : isize ) -> * const T
215
217
where
216
218
T : Sized ,
217
219
{
@@ -393,8 +395,9 @@ impl<T: ?Sized> *const T {
393
395
/// ```
394
396
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
395
397
#[ must_use = "returns a new pointer rather than modifying its argument" ]
398
+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
396
399
#[ inline]
397
- pub unsafe fn add ( self , count : usize ) -> Self
400
+ pub const unsafe fn add ( self , count : usize ) -> Self
398
401
where
399
402
T : Sized ,
400
403
{
@@ -455,8 +458,9 @@ impl<T: ?Sized> *const T {
455
458
/// ```
456
459
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
457
460
#[ must_use = "returns a new pointer rather than modifying its argument" ]
461
+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
458
462
#[ inline]
459
- pub unsafe fn sub ( self , count : usize ) -> Self
463
+ pub const unsafe fn sub ( self , count : usize ) -> Self
460
464
where
461
465
T : Sized ,
462
466
{
@@ -511,8 +515,9 @@ impl<T: ?Sized> *const T {
511
515
/// ```
512
516
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
513
517
#[ must_use = "returns a new pointer rather than modifying its argument" ]
518
+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
514
519
#[ inline]
515
- pub fn wrapping_add ( self , count : usize ) -> Self
520
+ pub const fn wrapping_add ( self , count : usize ) -> Self
516
521
where
517
522
T : Sized ,
518
523
{
@@ -567,8 +572,9 @@ impl<T: ?Sized> *const T {
567
572
/// ```
568
573
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
569
574
#[ must_use = "returns a new pointer rather than modifying its argument" ]
575
+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
570
576
#[ inline]
571
- pub fn wrapping_sub ( self , count : usize ) -> Self
577
+ pub const fn wrapping_sub ( self , count : usize ) -> Self
572
578
where
573
579
T : Sized ,
574
580
{
0 commit comments