We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const fn
I tried this code:
// SPDX-License-Identifier: Apache-2.0 OR MIT // kani-flags: -Z loop-contracts //! Check if loop contracts is correctly applied. #![feature(stmt_expr_attributes)] #![feature(proc_macro_hygiene)] pub const BASE: usize = count_zero(&[]); #[kani::proof] pub fn check_counter() { assert_eq!(count_zero(&[1, 2]), 0) } const fn count_zero(slice: &[u8]) -> usize { let mut counter: usize = 0; let mut index: usize = 0; #[kani::loop_invariant(counter < slice.len())] while index < slice.len() { if slice[index] == 0 { counter += 1; } index += 1; } counter }
with Kani version: #3151
I expected to see this happen: correctly compile.
Instead, this happened:
| 55 | kani_core::kani_lib!(kani); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code: ', /library/kani/src/lib.rs:55:1 |
The text was updated successfully, but these errors were encountered:
Resolved in #3151
Sorry, something went wrong.
qinheping
No branches or pull requests
I tried this code:
with Kani version: #3151
I expected to see this happen: correctly compile.
Instead, this happened:
The text was updated successfully, but these errors were encountered: