Skip to content

Commit c7067cf

Browse files
authored
Stabilize cover statement and update contracts RFC (rust-lang#3091)
I would like to propose that we stabilize the cover statement as is. Any further improvements or changes can be done separately, with or without an RFC. I am also updating the contracts RFC status since parts of it have been integrated to Kani, but it is still unstable. ### Call-out This PR requires at least 2 approvals.
1 parent 72d03ca commit c7067cf

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

library/kani/src/mem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use std::ptr::{DynMetadata, NonNull, Pointee};
4444
/// Note that an unaligned pointer is still considered valid.
4545
///
4646
/// TODO: Kani should automatically add those checks when a de-reference happens.
47-
/// https://github.com/model-checking/kani/issues/2975
47+
/// <https://github.com/model-checking/kani/issues/2975>
4848
///
4949
/// This function will either panic or return `true`. This is to make it easier to use it in
5050
/// contracts.

rfc/src/rfcs/0003-cover-statement.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- **Feature Name:** Cover statement (`cover-statement`)
22
- **Feature Request Issue:** <https://github.com/model-checking/kani/issues/696>
33
- **RFC PR:** <https://github.com/model-checking/kani/pull/1906>
4-
- **Status:** Unstable
5-
- **Version:** 1
4+
- **Status:** Stable
5+
- **Version:** 2
66

77
-------------------
88

@@ -138,8 +138,12 @@ However, if the condition can indeed be covered, verification would fail due to
138138

139139
## Open questions
140140

141-
Should we allow format arguments in the macro, e.g. `kani::cover!(x > y, "{} can be greater than {}", x, y)`?
142-
Users may expect this to be supported since the macro looks similar to the `assert` macro, but Kani doesn't include the formatted string in the message description, since it's not available at compile time.
141+
- ~Should we allow format arguments in the macro, e.g. `kani::cover!(x > y, "{} can be greater than {}", x, y)`?
142+
Users may expect this to be supported since the macro looks similar to the `assert` macro, but Kani doesn't include the formatted string in the message description, since it's not available at compile time.~
143+
- For now, this macro will not accept format arguments, since this
144+
is not well handled by Kani.
145+
This is an extesion to this API that can be easily added later on if Kani
146+
ever supports runtime formatting.
143147

144148
## Other Considerations
145149

rfc/src/rfcs/0009-function-contracts.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- **Feature Name:** Function Contracts
22
- **Feature Request Issue:** [#2652](https://github.com/model-checking/kani/issues/2652) and [Milestone](https://github.com/model-checking/kani/milestone/31)
33
- **RFC PR:** [#2620](https://github.com/model-checking/kani/pull/2620)
4-
- **Status:** Under Review
5-
- **Version:** 0
4+
- **Status:** Unstable
5+
- **Version:** 1
66
- **Proof-of-concept:** [features/contracts](https://github.com/model-checking/kani/tree/features/contracts)
77
- **Feature Gate:** `-Zfunction-contracts`, enforced by compile time error[^gate]
88

@@ -893,4 +893,5 @@ times larger than what they expect the function will touch).
893893

894894
[^stubcheck]: Kani cannot report the occurrence of a contract function to check
895895
in abstracted functions as errors, because the mechanism is needed to verify
896-
mutually recursive functions.
896+
mutually recursive functions.
897+

scripts/build-docs.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ else
2828
curl -sSL -o "$FILE" "$URL"
2929
echo "$EXPECTED_HASH $FILE" | sha256sum -c -
3030
tar zxf $FILE
31+
MDBOOK=${SCRIPT_DIR}/mdbook
32+
else
33+
MDBOOK=mdbook
3134
fi
32-
MDBOOK=${SCRIPT_DIR}/mdbook
3335
fi
3436

3537
KANI_DIR=$SCRIPT_DIR/..

0 commit comments

Comments
 (0)