-
Notifications
You must be signed in to change notification settings - Fork 89
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
Verification fails when comparing arrays and string slices. #356
Comments
This seems to be caused by the usage of a negative value in the The same failure can be reproduced by the following program: enum Foo {
A = -1,
B = 1,
}
fn main() {
let a = Some(Foo::A);
let b = Some(Foo::B);
let _ = matches!(a, Some(Foo::A));
let _ = matches!(b, Some(Foo::B));
}
|
This does successfully verify, for the record: #[kani::proof]
fn main() {
let x: i8 = unsafe { std::mem::transmute([3].cmp(&[4])) };
assert!(x == -1);
} But this does NOT verify: #[kani::proof]
fn main() {
let x: i8 = unsafe { std::mem::transmute([3].lt(&[4])) };
assert!(x == 1);
} So it seems like |
A possible thread to pull on, and then I need to stop getting nerd sniped by this problem:
Curiously, this succeeds: #[kani::proof]
fn main() {
let x: i8 = unsafe { std::mem::transmute([3].partial_cmp(&[4])) };
assert!(x == -1);
} After some experimentation, apparently this is a case where It could be that we're codegen'ing |
I tried this code:
using the following command line invocation:
with RMC version: 6962a67
I expected to see this happen: verification succeeds.
Instead, this happened: verification failed with the following assertions failures:
The text was updated successfully, but these errors were encountered: