@@ -43,7 +43,8 @@ use crate::convert::TryInto as _;
4343use crate :: slice:: memchr;
4444use 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) ]
4950use 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 ( ) ;
0 commit comments