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