@@ -4025,8 +4025,8 @@ impl<T> [T] {
4025
4025
}
4026
4026
}
4027
4027
) ]
4028
- //The following two ensures clauses guarantee that middle is of maximum size within self
4029
- //If U or T are ZST , then middle has size zero, so we adapt the check in that case
4028
+ //The following clause guarantees that middle is of maximum size within self
4029
+ //If U or T are ZSTs , then middle has size zero, so we adapt the check in that case
4030
4030
#[ ensures( |( prefix, _, suffix) : & ( & [ T ] , & [ U ] , & [ T ] ) |
4031
4031
( ( U :: IS_ZST || T :: IS_ZST ) && prefix. len( ) == self . len( ) ) || (
4032
4032
( prefix. len( ) * size_of:: <T >( ) < align_of:: <U >( ) ) &&
@@ -4170,8 +4170,8 @@ impl<T> [T] {
4170
4170
}
4171
4171
}
4172
4172
) ]
4173
- //The following two ensures clauses guarantee that middle is of maximum size within self
4174
- //If U or T are ZST , then middle has size zero, so we adapt the check in that case
4173
+ //The following clause guarantees that middle is of maximum size within self
4174
+ //If U or T are ZSTs , then middle has size zero, so we adapt the check in that case
4175
4175
#[ ensures( |( prefix, _, suffix) : & ( * const [ T ] , * const [ U ] , * const [ T ] ) |
4176
4176
( ( U :: IS_ZST || T :: IS_ZST ) && prefix. len( ) == self . len( ) ) || (
4177
4177
( prefix. len( ) * size_of:: <T >( ) < align_of:: <U >( ) ) &&
@@ -5376,6 +5376,7 @@ unsafe impl GetDisjointMutIndex for range::RangeInclusive<usize> {
5376
5376
mod verify {
5377
5377
use super :: * ;
5378
5378
5379
+ //generates proof_of_contract harness for align_to given the T (src) and U (dst) types
5379
5380
macro_rules! proof_of_contract_for_align_to {
5380
5381
( $harness: ident, $src: ty, $dst: ty) => {
5381
5382
#[ kani:: proof_for_contract( <[ $src] >:: align_to) ]
@@ -5388,6 +5389,7 @@ mod verify {
5388
5389
} ;
5389
5390
}
5390
5391
5392
+ //generates harnesses for align_to where T is a given src type and U is one of the main primitives
5391
5393
macro_rules! gen_align_to_harnesses {
5392
5394
( $mod_name: ident, $src_type: ty) => {
5393
5395
mod $mod_name {
@@ -5414,6 +5416,8 @@ mod verify {
5414
5416
gen_align_to_harnesses ! ( align_to_from_char, char ) ;
5415
5417
gen_align_to_harnesses ! ( align_to_from_unit, ( ) ) ;
5416
5418
5419
+ //generates proof_of_contract harness for align_to_mut given the T (src) and U (dst) types
5420
+ //this uses the contract for align_to_mut_wrapper (see comment there for why)
5417
5421
macro_rules! proof_of_contract_for_align_to_mut {
5418
5422
( $harness: ident, $src: ty, $dst: ty) => {
5419
5423
#[ kani:: proof_for_contract( <[ $src] >:: align_to_mut_wrapper) ]
@@ -5426,6 +5430,7 @@ mod verify {
5426
5430
} ;
5427
5431
}
5428
5432
5433
+ //generates harnesses between a given src type and all the main primitives
5429
5434
macro_rules! gen_align_to_mut_harnesses {
5430
5435
( $mod_name: ident, $src_type: ty) => {
5431
5436
mod $mod_name {
0 commit comments