You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
should_panic and --prove-safety-only treat postconditions and kani::assert as panics #5212
Z-Kani CompilerIssues that require some changes to the compiler[C] BugThis is a bug. Something isn't working.[F] SoundnessKani failed to detect an issue
should_panic accepts non-panics. kani p.rs -Z function-contracts reports both should_panic harnesses as VERIFICATION:- SUCCESSFUL (encountered one or more panics as expected), although neither panics: one fails its postcondition, the other a kani::assert.
--prove-safety-only drops postconditions and kani::assert. With -Z unstable-options --prove-safety-only, check_wrong_post verifies, because the flag assumes away every assertion-class check (codegen_assert_assume in assert.rs), including the postcondition.
Expected
should_panic counts only panics.
--prove-safety-only assumes only panics away and still checks postconditions and kani::assert.
Suggested fix
Give panics their own property class, panic:
codegen_panic and the panicking MIR assertions emit panic;
the assert!/assert_eq!/assert_ne! overrides call a Kani-internal function hooked to emit panic, instead of kani::assert;
kani::assert and contract conditions keep assertion;
the driver's should_panic classification and --prove-safety-only key on panic.
This changes some property names in the output. It is also the prerequisite for RFC #3893 (panics_only_if).
Z-Kani CompilerIssues that require some changes to the compiler[C] BugThis is a bug. Something isn't working.[F] SoundnessKani failed to detect an issue
Activity
Give Rust panics their own property class
Test the panics_only_if and panics_if clauses
RFC: Panic conditions in function contracts (model-checking#3893)
Add panics_only_if and panics_if contract clauses (model-checking#4230)