File tree Expand file tree Collapse file tree 6 files changed +23
-5
lines changed Expand file tree Collapse file tree 6 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,6 @@ description = "This crate contains contracts and harnesses for core library"
8
8
9
9
[package .metadata .kani ]
10
10
unstable = { function-contracts = true , mem-predicates = true }
11
+
12
+ [package .metadata .kani .flags ]
13
+ output-format = " terse"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ Summary:
2
+ Verification failed for - mem::verify::check_swap_unit
3
+ Complete - 3 successfully verified harnesses, 1 failures, 4 total.
Original file line number Diff line number Diff line change
1
+ Summary:
2
+ Verification failed for - ptr::verify::check_replace_unit
3
+ Complete - 5 successfully verified harnesses, 1 failures, 6 total.
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ mod verify {
42
42
contracts:: swap ( & mut x, & mut y)
43
43
}
44
44
45
+ /// FIX-ME: Modifies clause fail with pointer to ZST.
46
+ /// <https://github.com/model-checking/kani/issues/3181>
47
+ /// FIX-ME: `typed_swap` intrisic fails for ZST.
48
+ /// <https://github.com/model-checking/kani/issues/3182>
45
49
#[ kani:: proof_for_contract( contracts:: swap) ]
46
50
pub fn check_swap_unit ( ) {
47
51
let mut x: ( ) = kani:: any ( ) ;
Original file line number Diff line number Diff line change @@ -72,16 +72,22 @@ mod verify {
72
72
73
73
#[ kani:: proof_for_contract( contracts:: as_ref) ]
74
74
pub fn check_as_ref ( ) {
75
+ let ptr = kani:: any :: < Box < usize > > ( ) ;
76
+ let non_null = NonNull :: new ( Box :: into_raw ( ptr) ) . unwrap ( ) ;
77
+ let _rf = unsafe { contracts:: as_ref ( & non_null) } ;
78
+ }
79
+
80
+ #[ kani:: proof_for_contract( contracts:: as_ref) ]
81
+ #[ kani:: should_panic]
82
+ pub fn check_as_ref_dangling ( ) {
75
83
let ptr = kani:: any :: < usize > ( ) as * mut u8 ;
76
84
kani:: assume ( !ptr. is_null ( ) ) ;
77
- let Some ( non_null) = NonNull :: new ( ptr) else {
78
- unreachable ! ( ) ;
79
- } ;
85
+ let non_null = NonNull :: new ( ptr) . unwrap ( ) ;
80
86
let _rf = unsafe { contracts:: as_ref ( & non_null) } ;
81
87
}
82
88
83
89
/// FIX-ME: Modifies clause fail with pointer to ZST.
84
- # [ cfg ( fixme ) ]
90
+ /// <https://github.com/model-checking/kani/issues/3181>
85
91
#[ kani:: proof_for_contract( contracts:: replace) ]
86
92
pub fn check_replace_unit ( ) {
87
93
check_replace_impl :: < ( ) > ( ) ;
You can’t perform that action at this time.
0 commit comments