generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Labels
T-High PriorityTag issues that have high priorityTag issues that have high priorityZ-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.
Milestone
Description
I tried this code:
extern crate kani;
#[derive(PartialEq, Eq)]
enum Foo {
A,
B,
}
impl Foo {
#[kani::ensures(result == Foo::A)]
pub fn new() -> Foo {
Foo::A
}
}
#[kani::proof_for_contract(Foo::new)]
fn check() {
let _ = Foo::new();
}using the following command line invocation:
kani enum_ensures.rs -Zfunction-contracts
with Kani version: f10e61c
I expected to see this happen: Verification succeeds
Instead, this happened:
$ kani enum_ensures.rs -Zfunction-contracts
Kani Rust Verifier 0.51.0 (standalone)
error[E0425]: cannot find function `new_wrapper_faac06` in this scope
--> enum_ensures.rs:10:5
|
10 | #[kani::ensures(result == Foo::A)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= note: this error originates in the attribute macro `kani::ensures` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider using the associated function on `Self`
|
10 | Self::#[kani::ensures(result == Foo::A)]
| ++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0425`.
error: /home/ubuntu/git/kani/target/kani/bin/kani-compiler exited with status exit status: 1
Metadata
Metadata
Assignees
Labels
T-High PriorityTag issues that have high priorityTag issues that have high priorityZ-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.