Skip to content

Commit

Permalink
Add a few trait implementations to challenge
Browse files Browse the repository at this point in the history
also fix warnings in the tool template section
  • Loading branch information
celinval committed Nov 5, 2024
1 parent 44ce7cf commit 52ec29e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 11 additions & 2 deletions doc/src/challenges/0013-cstr.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ and that they maintain the overall safety invariant of `CStr` when called correc
| `from_bytes_with_nul_uncheked` | `core::ffi::c_str` |
| `strlen` | `core::ffi::c_str` |

4. Verify that the following trait implementations for the `CStr` type are safe:


| Trait | Implementation Location |
|-------------------------------------|-------------------------|
| `CloneToUninit` [^unsafe-fn] | `core::clone` |
| `ops::Index<ops::RangeFrom<usize>>` | `core::ffi::c_str` |

[^unsafe-fn]: Unsafe functions will require safety contracts.

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):

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

Note: All solutions to verification challenges need to satisfy the criteria established in the [challenge book](general-rules.md)
in addition to the ones listed above.
Note: All solutions to verification challenges need to satisfy the criteria established in the
[challenge book](../general-rules.md) in addition to the ones listed above.
6 changes: 3 additions & 3 deletions doc/src/tool_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ _Please list the license(s) that are used by your tool, and if to your knowledge

## Steps to Use the Tool

1. [First Step]
2. [Second Step]
3. [and so on...]
1. \[First Step\]
2. \[Second Step\]
3. \[and so on...\]

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

0 comments on commit 52ec29e

Please sign in to comment.