File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 230230#![ feature( unboxed_closures) ]
231231#![ feature( unsized_fn_params) ]
232232#![ feature( with_negative_coherence) ]
233+ // Required for Kani loop contracts, which are annotated as custom stmt attributes.
233234#![ feature( proc_macro_hygiene) ]
234235// tidy-alphabetical-end
235236//
Original file line number Diff line number Diff line change @@ -403,8 +403,8 @@ const fn is_ascii(s: &[u8]) -> bool {
403403 // tail is always one `usize` at most to extra branch `byte_pos == len`.
404404 #[ safety:: loop_invariant( byte_pos <= len
405405 && byte_pos >= offset_to_aligned
406- && word_ptr as usize >= start as usize + offset_to_aligned
407- && ( byte_pos - offset_to_aligned ) == ( word_ptr as usize - start as usize - offset_to_aligned ) ) ]
406+ && word_ptr. addr ( ) >= start. addr ( ) + offset_to_aligned
407+ && byte_pos == word_ptr. addr ( ) - start. addr ( ) ) ]
408408 while byte_pos < len - USIZE_SIZE {
409409 // Sanity check that the read is in bounds
410410 debug_assert ! ( byte_pos + USIZE_SIZE <= len) ;
@@ -449,7 +449,7 @@ pub mod verify {
449449 #[ kani:: unwind( 8 ) ]
450450 pub fn check_is_ascii ( ) {
451451 if kani:: any ( ) {
452- // TODO: ARR_SIZE can be `std::usize::MAX` with cbmc argument
452+ // TODO: ARR_SIZE can be much larger with cbmc argument
453453 // `--arrays-uf-always`
454454 const ARR_SIZE : usize = 1000 ;
455455 let mut x: [ u8 ; ARR_SIZE ] = kani:: any ( ) ;
You can’t perform that action at this time.
0 commit comments