I tried this code:
#[kani::proof]
pub fn check_invalid_ptr() {
let raw_ptr = {
let var = 10;
&var as *const _
};
// This should fail since it is de-referencing a dead object.
assert_eq !(unsafe {*raw_ptr}, 10);
}
using the following command line invocation:
with Kani version: 0.47
I expected to see this happen: Verification should fail since the de-referenced pointer is pointing to a dead object.
Instead, this happened: Verification succeeds