12
12
macro_rules! kani_mem {
13
13
( $core: tt) => {
14
14
use super :: kani_intrinsic;
15
- use $core:: marker:: MetaSized ;
15
+ use $core:: marker:: { MetaSized , PointeeSized } ;
16
16
use $core:: ptr:: { DynMetadata , NonNull , Pointee } ;
17
17
18
18
/// Check if the pointer is valid for write access according to [crate::mem] conditions 1, 2
@@ -117,12 +117,12 @@ macro_rules! kani_mem {
117
117
reason = "experimental memory predicate API"
118
118
) ]
119
119
#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
120
- pub fn same_allocation<T : MetaSized >( ptr1: * const T , ptr2: * const T ) -> bool {
120
+ pub fn same_allocation<T : PointeeSized >( ptr1: * const T , ptr2: * const T ) -> bool {
121
121
same_allocation_internal( ptr1, ptr2)
122
122
}
123
123
124
124
#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
125
- pub ( super ) fn same_allocation_internal<T : MetaSized >(
125
+ pub ( super ) fn same_allocation_internal<T : PointeeSized >(
126
126
ptr1: * const T ,
127
127
ptr2: * const T ,
128
128
) -> bool {
@@ -241,19 +241,19 @@ macro_rules! kani_mem {
241
241
/// - Users have to ensure that the pointed to memory is allocated.
242
242
#[ kanitool:: fn_marker = "ValidValueIntrinsic" ]
243
243
#[ inline( never) ]
244
- unsafe fn has_valid_value<T : MetaSized >( _ptr: * const T ) -> bool {
244
+ unsafe fn has_valid_value<T : PointeeSized >( _ptr: * const T ) -> bool {
245
245
kani_intrinsic( )
246
246
}
247
247
248
248
/// Check whether `len * size_of::<T>()` bytes are initialized starting from `ptr`.
249
249
#[ kanitool:: fn_marker = "IsInitializedIntrinsic" ]
250
250
#[ inline( never) ]
251
- pub ( crate ) fn is_initialized<T : MetaSized >( _ptr: * const T ) -> bool {
251
+ pub ( crate ) fn is_initialized<T : PointeeSized >( _ptr: * const T ) -> bool {
252
252
kani_intrinsic( )
253
253
}
254
254
255
255
/// A helper to assert `is_initialized` to use it as a part of other predicates.
256
- fn assert_is_initialized<T : MetaSized >( ptr: * const T ) -> bool {
256
+ fn assert_is_initialized<T : PointeeSized >( ptr: * const T ) -> bool {
257
257
super :: internal:: check(
258
258
is_initialized( ptr) ,
259
259
"Undefined Behavior: Reading from an uninitialized pointer" ,
@@ -281,7 +281,7 @@ macro_rules! kani_mem {
281
281
#[ doc( hidden) ]
282
282
#[ kanitool:: fn_marker = "PointerObjectHook" ]
283
283
#[ inline( never) ]
284
- pub ( crate ) fn pointer_object<T : MetaSized >( _ptr: * const T ) -> usize {
284
+ pub ( crate ) fn pointer_object<T : PointeeSized >( _ptr: * const T ) -> usize {
285
285
kani_intrinsic( )
286
286
}
287
287
@@ -294,7 +294,7 @@ macro_rules! kani_mem {
294
294
) ]
295
295
#[ kanitool:: fn_marker = "PointerOffsetHook" ]
296
296
#[ inline( never) ]
297
- pub fn pointer_offset<T : MetaSized >( _ptr: * const T ) -> usize {
297
+ pub fn pointer_offset<T : PointeeSized >( _ptr: * const T ) -> usize {
298
298
kani_intrinsic( )
299
299
}
300
300
} ;
0 commit comments