@@ -151,8 +151,9 @@ impl<T: ?Sized> *const T {
151151 /// ```
152152 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
153153 #[ must_use = "returns a new pointer rather than modifying its argument" ]
154+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
154155 #[ inline]
155- pub unsafe fn offset ( self , count : isize ) -> * const T
156+ pub const unsafe fn offset ( self , count : isize ) -> * const T
156157 where
157158 T : Sized ,
158159 {
@@ -210,8 +211,9 @@ impl<T: ?Sized> *const T {
210211 /// ```
211212 #[ stable( feature = "ptr_wrapping_offset" , since = "1.16.0" ) ]
212213 #[ must_use = "returns a new pointer rather than modifying its argument" ]
214+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
213215 #[ inline]
214- pub fn wrapping_offset ( self , count : isize ) -> * const T
216+ pub const fn wrapping_offset ( self , count : isize ) -> * const T
215217 where
216218 T : Sized ,
217219 {
@@ -393,8 +395,9 @@ impl<T: ?Sized> *const T {
393395 /// ```
394396 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
395397 #[ must_use = "returns a new pointer rather than modifying its argument" ]
398+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
396399 #[ inline]
397- pub unsafe fn add ( self , count : usize ) -> Self
400+ pub const unsafe fn add ( self , count : usize ) -> Self
398401 where
399402 T : Sized ,
400403 {
@@ -455,8 +458,9 @@ impl<T: ?Sized> *const T {
455458 /// ```
456459 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
457460 #[ must_use = "returns a new pointer rather than modifying its argument" ]
461+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
458462 #[ inline]
459- pub unsafe fn sub ( self , count : usize ) -> Self
463+ pub const unsafe fn sub ( self , count : usize ) -> Self
460464 where
461465 T : Sized ,
462466 {
@@ -511,8 +515,9 @@ impl<T: ?Sized> *const T {
511515 /// ```
512516 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
513517 #[ must_use = "returns a new pointer rather than modifying its argument" ]
518+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
514519 #[ inline]
515- pub fn wrapping_add ( self , count : usize ) -> Self
520+ pub const fn wrapping_add ( self , count : usize ) -> Self
516521 where
517522 T : Sized ,
518523 {
@@ -567,8 +572,9 @@ impl<T: ?Sized> *const T {
567572 /// ```
568573 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
569574 #[ must_use = "returns a new pointer rather than modifying its argument" ]
575+ #[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
570576 #[ inline]
571- pub fn wrapping_sub ( self , count : usize ) -> Self
577+ pub const fn wrapping_sub ( self , count : usize ) -> Self
572578 where
573579 T : Sized ,
574580 {
0 commit comments