-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Labels
[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.
Description
Description
The same_allocation
API currently cannot accept pointers to unit types as inputs, doing so will result in verification failures. Extending same_allocation
to support unit type pointers would enhance its usability, especially for implementing function contracts involving generic typed pointers. This capability would be particularly valuable for use cases like the one discussed here.
Example
#[kani::proof]
fn test_unit_type() {
let unit_obj = ();
let ptr1: *const () = &unit_obj;
let ptr2: *const () = &unit_obj;
assert!(kani::mem::same_allocation(ptr1, ptr2));
}
Running Kani on this proof produces the following error:
Failed Checks: Kani does not support reasoning about pointers to unallocated memory.
Metadata
Metadata
Assignees
Labels
[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.