File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 7878 # possible functions as that may take a lot longer than expected. Instead,
7979 # explicitly list all functions (or prefixes thereof) the proofs of which
8080 # are known to pass.
81+ # Notes:
82+ # - We use >::disjoint_bitor (and >::unchecked_disjoint_bitor) as pattern
83+ # as whitespace is not supported, cf.
84+ # https://github.com/model-checking/kani/issues/4046
8185 - name : Run Kani Verification
8286 run : |
8387 scripts/run-kani.sh --run autoharness --kani-args \
88+ --include-pattern ">::disjoint_bitor" \
89+ --include-pattern ">::unchecked_disjoint_bitor" \
8490 --include-pattern alloc::__default_lib_allocator:: \
8591 --include-pattern alloc::layout::Layout::from_size_align \
8692 --include-pattern ascii::ascii_char::AsciiChar::from_u8 \
Original file line number Diff line number Diff line change 77) ]
88#![ allow( missing_docs) ]
99
10+ use safety:: requires;
11+
12+ #[ cfg( kani) ]
13+ use crate :: kani;
14+
1015#[ const_trait]
1116#[ rustc_const_unstable( feature = "core_intrinsics_fallbacks" , issue = "none" ) ]
1217pub trait CarryingMulAdd : Copy + ' static {
@@ -132,6 +137,7 @@ macro_rules! impl_disjoint_bitor {
132137 impl const DisjointBitOr for $t {
133138 #[ cfg_attr( miri, track_caller) ]
134139 #[ inline]
140+ #[ requires( ( self & other) == zero!( $t) ) ]
135141 unsafe fn disjoint_bitor( self , other: Self ) -> Self {
136142 // Note that the assume here is required for UB detection in Miri!
137143
Original file line number Diff line number Diff line change @@ -1265,6 +1265,7 @@ macro_rules! uint_impl {
12651265 #[ unstable( feature = "disjoint_bitor" , issue = "135758" ) ]
12661266 #[ rustc_const_unstable( feature = "disjoint_bitor" , issue = "135758" ) ]
12671267 #[ inline]
1268+ #[ requires( ( self & other) == 0 ) ]
12681269 pub const unsafe fn unchecked_disjoint_bitor( self , other: Self ) -> Self {
12691270 assert_unsafe_precondition!(
12701271 check_language_ub,
You can’t perform that action at this time.
0 commit comments