Skip to content

Commit 708fcbe

Browse files
committed
Update Kani version
1 parent 458dc4a commit 708fcbe

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

library/core/src/alloc/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ mod verify {
655655
}
656656

657657
// pub const fn size(&self) -> usize
658-
//#[kani::proof]
658+
#[kani::proof]
659659
pub fn check_size() {
660660
let s = kani::any::<usize>();
661661
let a = kani::any::<usize>();
@@ -667,7 +667,7 @@ mod verify {
667667
}
668668

669669
// pub const fn align(&self) -> usize
670-
//#[kani::proof]
670+
#[kani::proof]
671671
pub fn check_align() {
672672
let layout = kani::any::<Layout>();
673673
assert!(layout.align().is_power_of_two());

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
#![feature(unboxed_closures)]
231231
#![feature(unsized_fn_params)]
232232
#![feature(with_negative_coherence)]
233-
#![cfg_attr(kani, feature(proc_macro_hygiene))]
233+
#![feature(proc_macro_hygiene)]
234234
// tidy-alphabetical-end
235235
//
236236
// Target features:

library/core/src/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ mod verify {
17701770
macro_rules! generate_carrying_mul_intervals {
17711771
($type:ty, $wide_type:ty, $($harness_name:ident, $min:expr, $max:expr),+) => {
17721772
$(
1773-
//#[kani::proof]
1773+
#[kani::proof]
17741774
pub fn $harness_name() {
17751775
let lhs: $type = kani::any::<$type>();
17761776
let rhs: $type = kani::any::<$type>();
@@ -1807,7 +1807,7 @@ mod verify {
18071807
macro_rules! generate_widening_mul_intervals {
18081808
($type:ty, $wide_type:ty, $($harness_name:ident, $min:expr, $max:expr),+) => {
18091809
$(
1810-
//#[kani::proof]
1810+
#[kani::proof]
18111811
pub fn $harness_name() {
18121812
let lhs: $type = kani::any::<$type>();
18131813
let rhs: $type = kani::any::<$type>();

library/core/src/ptr/unique.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ mod verify {
263263
}
264264

265265
// pub const unsafe fn as_ref(&self) -> &T
266-
//#[kani::proof]
266+
#[kani::proof]
267267
pub fn check_as_ref() {
268268
let mut x : i32 = kani::any();
269269
let xptr = &mut x;
@@ -274,7 +274,7 @@ mod verify {
274274
}
275275

276276
// pub const unsafe fn as_mut(&mut self) -> &mut T
277-
//#[kani::proof]
277+
#[kani::proof]
278278
pub fn check_as_mut() {
279279
let mut x : i32 = kani::any();
280280
let xptr = &mut x;
@@ -285,7 +285,7 @@ mod verify {
285285
}
286286

287287
// pub const fn cast<U>(self) -> Unique<U>
288-
//#[kani::proof]
288+
#[kani::proof]
289289
pub fn check_cast() {
290290
let mut x : i32 = kani::any();
291291
let xptr = &mut x;

library/core/src/str/pattern.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ use crate::convert::TryInto as _;
4343
use crate::slice::memchr;
4444
use crate::{cmp, fmt};
4545

46-
use safety::{requires, ensures};
46+
#[cfg(all(target_arch = "x86_64", any(kani, target_feature = "sse2")))] // only called on x86
47+
use safety::{loop_invariant, requires};
4748

4849
#[cfg(kani)]
4950
use crate::kani;
@@ -1959,7 +1960,7 @@ unsafe fn small_slice_eq(x: &[u8], y: &[u8]) -> bool {
19591960
unsafe {
19601961
let (mut px, mut py) = (x.as_ptr(), y.as_ptr());
19611962
let (pxend, pyend) = (px.add(x.len() - 4), py.add(y.len() - 4));
1962-
#[safety::loop_invariant(same_allocation(x.as_ptr(), px) && same_allocation(y.as_ptr(), py)
1963+
#[loop_invariant(same_allocation(x.as_ptr(), px) && same_allocation(y.as_ptr(), py)
19631964
&& px as isize >= x.as_ptr() as isize
19641965
&& py as isize >= y.as_ptr() as isize
19651966
&& px as isize - x.as_ptr() as isize == (py as isize - y.as_ptr() as isize))]
@@ -1987,7 +1988,7 @@ pub mod verify {
19871988
#[kani::proof]
19881989
#[kani::unwind(4)]
19891990
pub fn check_small_slice_eq() {
1990-
// ARR_SIZE can `std::usize::MAX` with cbmc argument
1991+
// TODO: ARR_SIZE can be `std::usize::MAX` with cbmc argument
19911992
// `--arrays-uf-always`
19921993
const ARR_SIZE: usize = 1000;
19931994
let x: [u8; ARR_SIZE] = kani::any();

library/core/src/unicode/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ mod verify {
3838
use crate::kani;
3939

4040
/// Checks that `to_upper` does not trigger UB or panics for all valid characters.
41-
//#[kani::proof]
41+
#[kani::proof]
4242
fn check_to_upper_safety() {
4343
let _ = to_upper(kani::any());
4444
}
4545

4646
/// Checks that `to_lower` does not trigger UB or panics for all valid characters.
47-
//#[kani::proof]
47+
#[kani::proof]
4848
fn check_to_lower_safety() {
4949
let _ = to_lower(kani::any());
5050
}

tool_config/kani-version.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# incompatible with the verify-std repo.
33

44
[kani]
5-
commit = "2565ef65767a696f1d519b42621b4e502e8970d0"
5+
commit = "8400296f5280be4f99820129bc66447e8dff63f4"

0 commit comments

Comments
 (0)