Skip to content

Commit 52ec29e

Browse files
committed
Add a few trait implementations to challenge
also fix warnings in the tool template section
1 parent 44ce7cf commit 52ec29e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

doc/src/challenges/0013-cstr.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ and that they maintain the overall safety invariant of `CStr` when called correc
6363
| `from_bytes_with_nul_uncheked` | `core::ffi::c_str` |
6464
| `strlen` | `core::ffi::c_str` |
6565

66+
4. Verify that the following trait implementations for the `CStr` type are safe:
67+
68+
69+
| Trait | Implementation Location |
70+
|-------------------------------------|-------------------------|
71+
| `CloneToUninit` [^unsafe-fn] | `core::clone` |
72+
| `ops::Index<ops::RangeFrom<usize>>` | `core::ffi::c_str` |
73+
74+
[^unsafe-fn]: Unsafe functions will require safety contracts.
6675

6776
All proofs must automatically ensure the absence of the following undefined behaviors [ref](https://github.com/rust-lang/reference/blob/142b2ed77d33f37a9973772bd95e6144ed9dce43/src/behavior-considered-undefined.md):
6877

@@ -71,5 +80,5 @@ All proofs must automatically ensure the absence of the following undefined beha
7180
- Mutating immutable bytes.
7281
- Accessing uninitialized memory.
7382

74-
Note: All solutions to verification challenges need to satisfy the criteria established in the [challenge book](general-rules.md)
75-
in addition to the ones listed above.
83+
Note: All solutions to verification challenges need to satisfy the criteria established in the
84+
[challenge book](../general-rules.md) in addition to the ones listed above.

doc/src/tool_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ _Please list the license(s) that are used by your tool, and if to your knowledge
2020

2121
## Steps to Use the Tool
2222

23-
1. [First Step]
24-
2. [Second Step]
25-
3. [and so on...]
23+
1. \[First Step\]
24+
2. \[Second Step\]
25+
3. \[and so on...\]
2626

2727
## Artifacts
2828
_If there are noteworthy examples of using the tool to perform verificaiton, please include them in this section.Links, papers, etc._

0 commit comments

Comments
 (0)