Feature Request: Support for Unsized Types in kani::mem::same_allocation
API
#3663
Labels
[C] Feature / Enhancement
A new feature request or enhancement to an existing feature.
Description
The
same_allocation
API currently does not accept pointers to unsized types, such asdyn Trait
. This feature is essential for implementing function contracts for certain pointer arithmetic operations within Rust's standard library. For example:In this case,
same_allocation
could be used in anensures
clause to restrict that both the input and output pointers reference the same object, like so:#[ensures(|result| kani::mem::same_allocation(self as *const T, *result as *const T))]
However, this code currently fails to compile because
T
may be unsized. Extendingsame_allocation
to handle unsized types would greatly benefit cases where function contracts contain unsized pointers.The text was updated successfully, but these errors were encountered: