File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1916,8 +1916,10 @@ mod verify {
1916
1916
let upper = kani:: any_where ( |x| * x < ARR_SIZE && * x >= lower) ;
1917
1917
unsafe {
1918
1918
// NOTE: The `index` parameter cannot be used in the function contracts without being moved.
1919
- // Since `SliceIndex` does not guarantee that `index` implements `Clone` or `Copy`. To ensure 'index' is only used once,
1920
- // we put the in-bound check in proof harness as a workaround
1919
+ // Since the `SliceIndex` trait does not guarantee that `index` implements `Clone` or `Copy`,
1920
+ // it cannot be reused after being consumed in the precondition. To comply with Rust's ownership
1921
+ // rules and ensure `index` is only used once, the in-bounds check is moved to the proof harness
1922
+ // as a workaround.
1921
1923
kani:: assume ( ptr. as_ref ( ) . get ( lower..upper) . is_some ( ) ) ;
1922
1924
let _ = ptr. get_unchecked_mut ( lower..upper) ;
1923
1925
}
You can’t perform that action at this time.
0 commit comments