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
This PR adds Challenge 25 for VecDeque
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
---------
Co-authored-by: Michael Tautschnig <[email protected]>
Verify the safety of `VecDeque` functions in (library/alloc/src/collections/vec_deque/mod.rs).
15
+
16
+
17
+
### Success Criteria
18
+
19
+
Verify the safety of the following functions in (library/alloc/src/collections/vec_deque/mod.rs):
20
+
21
+
Write and prove the contract for the safety of the following unsafe functions:
22
+
23
+
| Function |
24
+
|---------|
25
+
|push_unchecked|
26
+
|buffer_read|
27
+
|buffer_write|
28
+
|buffer_range|
29
+
|copy|
30
+
|copy_nonoverlapping|
31
+
|wrap_copy|
32
+
|copy_slice|
33
+
|write_iter|
34
+
|write_iter_wrapping|
35
+
|handle_capacity_increase|
36
+
|from_contiguous_raw_parts_in|
37
+
|abort_shrink|
38
+
39
+
Prove the absence of undefined behavior for following safe abstractions:
40
+
41
+
|get|
42
+
|get_mut|
43
+
|swap|
44
+
|reserve_exact|
45
+
|reserve|
46
+
|try_reserve_exact|
47
+
|try_reserve|
48
+
|shrink_to|
49
+
|truncate|
50
+
|as_slices|
51
+
|as_mut_slices|
52
+
|range|
53
+
|range_mut|
54
+
|drain|
55
+
|pop_front|
56
+
|pop_back|
57
+
|push_front|
58
+
|push_back|
59
+
|insert|
60
+
|remove|
61
+
|split_off|
62
+
|append|
63
+
|retain_mut|
64
+
|grow|
65
+
|resize_with|
66
+
|make_contiguous|
67
+
|rotate_left|
68
+
|rotate_right|
69
+
|rotate_left_inner|
70
+
|rotate_right_inner|
71
+
72
+
The verification must be unbounded---it must hold for slices of arbitrary length.
73
+
74
+
The verification must hold for generic type `T` (no monomorphization).
75
+
76
+
### List of UBs
77
+
78
+
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):
79
+
80
+
* Accessing (loading from or storing to) a place that is dangling or based on a misaligned pointer.
81
+
* Reading from uninitialized memory except for padding or unions.
82
+
* Mutating immutable bytes.
83
+
* Producing an invalid value
84
+
85
+
86
+
Note: All solutions to verification challenges need to satisfy the criteria established in the [challenge book](../general-rules.md)
0 commit comments