@@ -477,17 +477,17 @@ impl<T: ?Sized> *mut T {
477
477
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
478
478
#[ requires(
479
479
// If count is zero, any pointer is valid including null pointer.
480
- ( count == 0 ) ||
480
+ ( count == 0 ) ||
481
481
// Else if count is not zero, then ensure that subtracting `count` doesn't
482
482
// cause overflow and that both pointers `self` and the result are in the
483
483
// same allocation
484
- ( ( self . addr( ) as isize ) . checked_add( count) . is_some( ) &&
485
- kani :: mem :: same_allocation( self , self . wrapping_byte_offset( count) ) )
484
+ ( ( self . addr( ) as isize ) . checked_add( count) . is_some( ) &&
485
+ core :: ub_checks :: same_allocation( self , self . wrapping_byte_offset( count) ) )
486
486
) ]
487
487
#[ ensures( |& result|
488
488
// The resulting pointer should either be unchanged or still point to the same allocation
489
489
( self . addr( ) == result. addr( ) ) ||
490
- ( kani :: mem :: same_allocation( self , result) )
490
+ ( core :: ub_checks :: same_allocation( self , result) )
491
491
) ]
492
492
pub const unsafe fn byte_offset ( self , count : isize ) -> Self {
493
493
// SAFETY: the caller must uphold the safety contract for `offset`.
@@ -1102,17 +1102,17 @@ impl<T: ?Sized> *mut T {
1102
1102
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
1103
1103
#[ requires(
1104
1104
// If count is zero, any pointer is valid including null pointer.
1105
- ( count == 0 ) ||
1105
+ ( count == 0 ) ||
1106
1106
// Else if count is not zero, then ensure that subtracting `count` doesn't
1107
1107
// cause overflow and that both pointers `self` and the result are in the
1108
1108
// same allocation
1109
- ( ( self . addr( ) as isize ) . checked_add( count as isize ) . is_some( ) &&
1110
- kani :: mem :: same_allocation( self , self . wrapping_byte_add( count) ) )
1109
+ ( ( self . addr( ) as isize ) . checked_add( count as isize ) . is_some( ) &&
1110
+ core :: ub_checks :: same_allocation( self , self . wrapping_byte_add( count) ) )
1111
1111
) ]
1112
1112
#[ ensures( |& result|
1113
1113
// The resulting pointer should either be unchanged or still point to the same allocation
1114
1114
( self . addr( ) == result. addr( ) ) ||
1115
- ( kani :: mem :: same_allocation( self , result) )
1115
+ ( core :: ub_checks :: same_allocation( self , result) )
1116
1116
) ]
1117
1117
pub const unsafe fn byte_add ( self , count : usize ) -> Self {
1118
1118
// SAFETY: the caller must uphold the safety contract for `add`.
@@ -1248,17 +1248,17 @@ impl<T: ?Sized> *mut T {
1248
1248
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
1249
1249
#[ requires(
1250
1250
// If count is zero, any pointer is valid including null pointer.
1251
- ( count == 0 ) ||
1251
+ ( count == 0 ) ||
1252
1252
// Else if count is not zero, then ensure that subtracting `count` doesn't
1253
1253
// cause overflow and that both pointers `self` and the result are in the
1254
1254
// same allocation
1255
- ( ( self . addr( ) as isize ) . checked_sub( count as isize ) . is_some( ) &&
1256
- kani :: mem :: same_allocation( self , self . wrapping_byte_sub( count) ) )
1255
+ ( ( self . addr( ) as isize ) . checked_sub( count as isize ) . is_some( ) &&
1256
+ core :: ub_checks :: same_allocation( self , self . wrapping_byte_sub( count) ) )
1257
1257
) ]
1258
1258
#[ ensures( |& result|
1259
1259
// The resulting pointer should either be unchanged or still point to the same allocation
1260
1260
( self . addr( ) == result. addr( ) ) ||
1261
- ( kani :: mem :: same_allocation( self , result) )
1261
+ ( core :: ub_checks :: same_allocation( self , result) )
1262
1262
) ]
1263
1263
pub const unsafe fn byte_sub ( self , count : usize ) -> Self {
1264
1264
// SAFETY: the caller must uphold the safety contract for `sub`.
0 commit comments