@@ -416,7 +416,7 @@ impl<T: ?Sized> *const T {
416
416
#[ must_use = "returns a new pointer rather than modifying its argument" ]
417
417
#[ rustc_const_stable( feature = "const_ptr_offset" , since = "1.61.0" ) ]
418
418
#[ inline( always) ]
419
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
419
+ #[ track_caller]
420
420
pub const unsafe fn offset ( self , count : isize ) -> * const T
421
421
where
422
422
T : Sized ,
@@ -469,7 +469,7 @@ impl<T: ?Sized> *const T {
469
469
#[ inline( always) ]
470
470
#[ stable( feature = "pointer_byte_offsets" , since = "1.75.0" ) ]
471
471
#[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "1.75.0" ) ]
472
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
472
+ #[ track_caller]
473
473
pub const unsafe fn byte_offset ( self , count : isize ) -> Self {
474
474
// SAFETY: the caller must uphold the safety contract for `offset`.
475
475
unsafe { self . cast :: < u8 > ( ) . offset ( count) . with_metadata_of ( self ) }
@@ -767,7 +767,7 @@ impl<T: ?Sized> *const T {
767
767
#[ stable( feature = "ptr_sub_ptr" , since = "CURRENT_RUSTC_VERSION" ) ]
768
768
#[ rustc_const_stable( feature = "const_ptr_sub_ptr" , since = "CURRENT_RUSTC_VERSION" ) ]
769
769
#[ inline]
770
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
770
+ #[ track_caller]
771
771
pub const unsafe fn offset_from_unsigned ( self , origin : * const T ) -> usize
772
772
where
773
773
T : Sized ,
@@ -812,7 +812,7 @@ impl<T: ?Sized> *const T {
812
812
#[ stable( feature = "ptr_sub_ptr" , since = "CURRENT_RUSTC_VERSION" ) ]
813
813
#[ rustc_const_stable( feature = "const_ptr_sub_ptr" , since = "CURRENT_RUSTC_VERSION" ) ]
814
814
#[ inline]
815
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
815
+ #[ track_caller]
816
816
pub const unsafe fn byte_offset_from_unsigned < U : ?Sized > ( self , origin : * const U ) -> usize {
817
817
// SAFETY: the caller must uphold the safety contract for `sub_ptr`.
818
818
unsafe { self . cast :: < u8 > ( ) . offset_from_unsigned ( origin. cast :: < u8 > ( ) ) }
@@ -926,7 +926,7 @@ impl<T: ?Sized> *const T {
926
926
#[ must_use = "returns a new pointer rather than modifying its argument" ]
927
927
#[ rustc_const_stable( feature = "const_ptr_offset" , since = "1.61.0" ) ]
928
928
#[ inline( always) ]
929
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
929
+ #[ track_caller]
930
930
pub const unsafe fn add ( self , count : usize ) -> Self
931
931
where
932
932
T : Sized ,
@@ -978,7 +978,7 @@ impl<T: ?Sized> *const T {
978
978
#[ inline( always) ]
979
979
#[ stable( feature = "pointer_byte_offsets" , since = "1.75.0" ) ]
980
980
#[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "1.75.0" ) ]
981
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
981
+ #[ track_caller]
982
982
pub const unsafe fn byte_add ( self , count : usize ) -> Self {
983
983
// SAFETY: the caller must uphold the safety contract for `add`.
984
984
unsafe { self . cast :: < u8 > ( ) . add ( count) . with_metadata_of ( self ) }
@@ -1032,7 +1032,7 @@ impl<T: ?Sized> *const T {
1032
1032
#[ must_use = "returns a new pointer rather than modifying its argument" ]
1033
1033
#[ rustc_const_stable( feature = "const_ptr_offset" , since = "1.61.0" ) ]
1034
1034
#[ inline( always) ]
1035
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
1035
+ #[ track_caller]
1036
1036
pub const unsafe fn sub ( self , count : usize ) -> Self
1037
1037
where
1038
1038
T : Sized ,
@@ -1090,7 +1090,7 @@ impl<T: ?Sized> *const T {
1090
1090
#[ inline( always) ]
1091
1091
#[ stable( feature = "pointer_byte_offsets" , since = "1.75.0" ) ]
1092
1092
#[ rustc_const_stable( feature = "const_pointer_byte_offsets" , since = "1.75.0" ) ]
1093
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
1093
+ #[ track_caller]
1094
1094
pub const unsafe fn byte_sub ( self , count : usize ) -> Self {
1095
1095
// SAFETY: the caller must uphold the safety contract for `sub`.
1096
1096
unsafe { self . cast :: < u8 > ( ) . sub ( count) . with_metadata_of ( self ) }
@@ -1263,7 +1263,7 @@ impl<T: ?Sized> *const T {
1263
1263
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
1264
1264
#[ rustc_const_stable( feature = "const_ptr_read" , since = "1.71.0" ) ]
1265
1265
#[ inline]
1266
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
1266
+ #[ track_caller]
1267
1267
pub const unsafe fn read ( self ) -> T
1268
1268
where
1269
1269
T : Sized ,
@@ -1284,7 +1284,7 @@ impl<T: ?Sized> *const T {
1284
1284
/// [`ptr::read_volatile`]: crate::ptr::read_volatile()
1285
1285
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
1286
1286
#[ inline]
1287
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
1287
+ #[ track_caller]
1288
1288
pub unsafe fn read_volatile ( self ) -> T
1289
1289
where
1290
1290
T : Sized ,
@@ -1304,7 +1304,7 @@ impl<T: ?Sized> *const T {
1304
1304
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
1305
1305
#[ rustc_const_stable( feature = "const_ptr_read" , since = "1.71.0" ) ]
1306
1306
#[ inline]
1307
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
1307
+ #[ track_caller]
1308
1308
pub const unsafe fn read_unaligned ( self ) -> T
1309
1309
where
1310
1310
T : Sized ,
@@ -1324,7 +1324,7 @@ impl<T: ?Sized> *const T {
1324
1324
#[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.83.0" ) ]
1325
1325
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
1326
1326
#[ inline]
1327
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
1327
+ #[ track_caller]
1328
1328
pub const unsafe fn copy_to ( self , dest : * mut T , count : usize )
1329
1329
where
1330
1330
T : Sized ,
@@ -1344,7 +1344,7 @@ impl<T: ?Sized> *const T {
1344
1344
#[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.83.0" ) ]
1345
1345
#[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
1346
1346
#[ inline]
1347
- #[ cfg_attr ( miri , track_caller) ] // even without panics, this helps for Miri backtraces
1347
+ #[ track_caller]
1348
1348
pub const unsafe fn copy_to_nonoverlapping ( self , dest : * mut T , count : usize )
1349
1349
where
1350
1350
T : Sized ,
0 commit comments