generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Labels
Z-ContractsIssue related to code contractsIssue related to code contracts[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.
Description
I tried this code:
#[ensures(|result| result.as_usize().is_power_of_two())]
pub const fn Align_of<T>() -> Self {
// This can't actually panic since type alignment is always a power of two.
const { Alignment::new(mem::align_of::<T>()).unwrap() }
}
#[kani::proof_for_contract(Alignment::of)]
pub fn check_of_i32() {
let _ = Align_of::<i32>();
}
and
#[kani::proof]
pub fn check_of_i32() {
let a = Align_of::<i32>();
assert!(a.as_usize().is_power_of_two());
}
using the following command line invocation:
kani src/main.rs -Z function-contracts
with Kani version: 0.59.0
I expected to see this happen: The same results for both harnesses.
Instead, this happened: The kani::proof_for_contract failed but the kani::proof succeed
Metadata
Metadata
Assignees
Labels
Z-ContractsIssue related to code contractsIssue related to code contracts[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.