forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9d0e74
commit 93207e4
Showing
11 changed files
with
68 additions
and
633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Challenge 21: Verify the safety of `slice` iter functions - part 2 | ||
|
||
- **Status:** Open | ||
- **Tracking Issue:** [#29](https://github.com/model-checking/verify-rust-std/issues/29) | ||
- **Start date:** *2025/03/07* | ||
- **End date:** *2025/10/17* | ||
- **Reward:** *?* | ||
|
||
------------------- | ||
|
||
|
||
## Goal | ||
|
||
Verify the safety of iter functions that are defined in (library/core/src/iter/adapters): | ||
|
||
|
||
|
||
### Success Criteria | ||
|
||
Write and prove the contract for the safety of the following functions: | ||
|
||
| Function | Defined in | | ||
|---------| ---------| | ||
|next_back_remainder| array_chunks.rs| | ||
|fold| array_chunks.rs| | ||
|__iterator_get_unchecked| clone.rs| | ||
|fold| clone.rs| | ||
|next_unchecked| clone.rs| | ||
|__iterator_get_unchecked| copied.rs| | ||
|spec_next_chunk| copied.rs| | ||
|__iterator_get_unchecked| enumerate.rs| | ||
|next_chunk| filter.rs| | ||
|next_chunk| filter_map.rs| | ||
|__iterator_get_unchecked | fuse.rs| | ||
|__iterator_get_unchecked | map.rs| | ||
|next_unchecked | map.rs| | ||
|as_array_ref | map_windows.rs| | ||
|as_uninit_array_mut | map_windows.rs| | ||
|push | map_windows.rs| | ||
|drop | map_windows.rs| | ||
|__iterator_get_unchecked | skip.rs| | ||
|original_step | step_by.rs| | ||
|spec_fold| take.rs| | ||
|spec_for_each| take.rs| | ||
|__iterator_get_unchecked | zip.rs| | ||
|get_unchecked| zip.rs| | ||
|fold| zip.rs| | ||
|next| zip.rs| | ||
|nth| zip.rs| | ||
|next_back| zip.rs| | ||
|spec_fold| zip.rs| | ||
|
||
The verification must be unbounded---it must hold for slices of arbitrary length. | ||
|
||
The verification must be hold for generic type `T` (no monomorphization). | ||
|
||
### List of UBs | ||
|
||
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): | ||
|
||
* Accessing (loading from or storing to) a place that is dangling or based on a misaligned pointer. | ||
* Reading from uninitialized memory except for padding or unions. | ||
* Mutating immutable bytes. | ||
* Producing an invalid value | ||
|
||
|
||
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. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.