File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 230
230
#![ feature( unboxed_closures) ]
231
231
#![ feature( unsized_fn_params) ]
232
232
#![ feature( with_negative_coherence) ]
233
+ // Required for Kani loop contracts, which are annotated as custom stmt attributes.
233
234
#![ feature( proc_macro_hygiene) ]
234
235
// tidy-alphabetical-end
235
236
//
Original file line number Diff line number Diff line change @@ -403,8 +403,8 @@ const fn is_ascii(s: &[u8]) -> bool {
403
403
// tail is always one `usize` at most to extra branch `byte_pos == len`.
404
404
#[ safety:: loop_invariant( byte_pos <= len
405
405
&& 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 ( ) ) ]
408
408
while byte_pos < len - USIZE_SIZE {
409
409
// Sanity check that the read is in bounds
410
410
debug_assert ! ( byte_pos + USIZE_SIZE <= len) ;
@@ -449,7 +449,7 @@ pub mod verify {
449
449
#[ kani:: unwind( 8 ) ]
450
450
pub fn check_is_ascii ( ) {
451
451
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
453
453
// `--arrays-uf-always`
454
454
const ARR_SIZE : usize = 1000 ;
455
455
let mut x: [ u8 ; ARR_SIZE ] = kani:: any ( ) ;
You can’t perform that action at this time.
0 commit comments