Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot verify a constant function with contracts #3254

Closed
celinval opened this issue Jun 11, 2024 · 0 comments · Fixed by #3255
Closed

Cannot verify a constant function with contracts #3254

celinval opened this issue Jun 11, 2024 · 0 comments · Fixed by #3255
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@celinval
Copy link
Contributor

I tried this code:

#[kani::requires(true)]
#[inline]
const unsafe fn dummy<T>(arg: *const T) -> T {
    std::ptr::read(arg)
}

#[kani::proof_for_contract(dummy)]
fn check() {
    unsafe { dummy(&kani::any::<u8>()) };
}

using the following command line invocation:

kani -Z function-contracts dummy.rs

with Kani version:

I expected to see this happen: verification succeed

Instead, this happened: Kani failed to compile

@celinval celinval added the [C] Bug This is a bug. Something isn't working. label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant