@@ -461,6 +461,7 @@ impl<T: ?Sized> *mut T {
461461 #[ must_use = "returns a new pointer rather than modifying its argument" ]
462462 #[ rustc_const_stable( feature = "const_ptr_offset" , since = "1.61.0" ) ]
463463 #[ inline( always) ]
464+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
464465 pub const unsafe fn offset ( self , count : isize ) -> * mut T
465466 where
466467 T : Sized ,
@@ -485,6 +486,7 @@ impl<T: ?Sized> *mut T {
485486 #[ inline( always) ]
486487 #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
487488 #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
489+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
488490 pub const unsafe fn byte_offset ( self , count : isize ) -> Self {
489491 // SAFETY: the caller must uphold the safety contract for `offset`.
490492 let this = unsafe { self . cast :: < u8 > ( ) . offset ( count) . cast :: < ( ) > ( ) } ;
@@ -824,6 +826,7 @@ impl<T: ?Sized> *mut T {
824826 #[ stable( feature = "ptr_offset_from" , since = "1.47.0" ) ]
825827 #[ rustc_const_unstable( feature = "const_ptr_offset_from" , issue = "92980" ) ]
826828 #[ inline( always) ]
829+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
827830 pub const unsafe fn offset_from ( self , origin : * const T ) -> isize
828831 where
829832 T : Sized ,
@@ -844,6 +847,7 @@ impl<T: ?Sized> *mut T {
844847 #[ inline( always) ]
845848 #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
846849 #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
850+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
847851 pub const unsafe fn byte_offset_from ( self , origin : * const T ) -> isize {
848852 // SAFETY: the caller must uphold the safety contract for `offset_from`.
849853 unsafe { self . cast :: < u8 > ( ) . offset_from ( origin. cast :: < u8 > ( ) ) }
@@ -913,6 +917,7 @@ impl<T: ?Sized> *mut T {
913917 #[ unstable( feature = "ptr_sub_ptr" , issue = "95892" ) ]
914918 #[ rustc_const_unstable( feature = "const_ptr_sub_ptr" , issue = "95892" ) ]
915919 #[ inline]
920+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
916921 pub const unsafe fn sub_ptr ( self , origin : * const T ) -> usize
917922 where
918923 T : Sized ,
@@ -976,6 +981,7 @@ impl<T: ?Sized> *mut T {
976981 #[ must_use = "returns a new pointer rather than modifying its argument" ]
977982 #[ rustc_const_stable( feature = "const_ptr_offset" , since = "1.61.0" ) ]
978983 #[ inline( always) ]
984+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
979985 pub const unsafe fn add ( self , count : usize ) -> Self
980986 where
981987 T : Sized ,
@@ -998,6 +1004,7 @@ impl<T: ?Sized> *mut T {
9981004 #[ inline( always) ]
9991005 #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
10001006 #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1007+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
10011008 pub const unsafe fn byte_add ( self , count : usize ) -> Self {
10021009 // SAFETY: the caller must uphold the safety contract for `add`.
10031010 let this = unsafe { self . cast :: < u8 > ( ) . add ( count) . cast :: < ( ) > ( ) } ;
@@ -1060,6 +1067,7 @@ impl<T: ?Sized> *mut T {
10601067 #[ must_use = "returns a new pointer rather than modifying its argument" ]
10611068 #[ rustc_const_stable( feature = "const_ptr_offset" , since = "1.61.0" ) ]
10621069 #[ inline]
1070+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
10631071 pub const unsafe fn sub ( self , count : usize ) -> Self
10641072 where
10651073 T : Sized ,
@@ -1083,6 +1091,7 @@ impl<T: ?Sized> *mut T {
10831091 #[ inline( always) ]
10841092 #[ unstable( feature = "pointer_byte_offsets" , issue = "96283" ) ]
10851093 #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" , issue = "96283" ) ]
1094+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
10861095 pub const unsafe fn byte_sub ( self , count : usize ) -> Self {
10871096 // SAFETY: the caller must uphold the safety contract for `sub`.
10881097 let this = unsafe { self . cast :: < u8 > ( ) . sub ( count) . cast :: < ( ) > ( ) } ;
@@ -1319,6 +1328,7 @@ impl<T: ?Sized> *mut T {
13191328 #[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.63.0" ) ]
13201329 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
13211330 #[ inline( always) ]
1331+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
13221332 pub const unsafe fn copy_to ( self , dest : * mut T , count : usize )
13231333 where
13241334 T : Sized ,
@@ -1338,6 +1348,7 @@ impl<T: ?Sized> *mut T {
13381348 #[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.63.0" ) ]
13391349 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
13401350 #[ inline( always) ]
1351+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
13411352 pub const unsafe fn copy_to_nonoverlapping ( self , dest : * mut T , count : usize )
13421353 where
13431354 T : Sized ,
@@ -1357,6 +1368,7 @@ impl<T: ?Sized> *mut T {
13571368 #[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.63.0" ) ]
13581369 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
13591370 #[ inline( always) ]
1371+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
13601372 pub const unsafe fn copy_from ( self , src : * const T , count : usize )
13611373 where
13621374 T : Sized ,
@@ -1376,6 +1388,7 @@ impl<T: ?Sized> *mut T {
13761388 #[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.63.0" ) ]
13771389 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
13781390 #[ inline( always) ]
1391+ #[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
13791392 pub const unsafe fn copy_from_nonoverlapping ( self , src : * const T , count : usize )
13801393 where
13811394 T : Sized ,
0 commit comments