generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 129
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.
Milestone
Description
I tried this code:
trait Foo {
fn foo() -> usize;
}
struct Bar;
impl Foo for Bar {
fn foo() -> usize {
1
}
}
fn foo_stub() -> usize {
2
}
#[kani::proof]
#[kani::stub(Bar::foo, foo_stub)]
fn my_proof() {
assert_eq!(Bar::foo(), 2)
}using the following command line invocation:
cargo kani --enable-unstable --enable-stubbing --harness my_proof
with Kani version: 0.29.0
I expected to see this happen: Verification to pass, with the implementation of the foo trait method for Bar being stubbed out.
Instead, this happened:
error: failed to resolve `Bar::foo`: unable to find `foo` inside struct `Bar`
--> <...>
|
559 | #[kani::stub(Bar::foo, foo_stub)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the attribute macro `kani::stub` (in Nightly builds, run with -Z macro-backtrace for more info)
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.