Skip to content

Commit dcb4f89

Browse files
authored
Add alloc::sync cases
1 parent 27df640 commit dcb4f89

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

doc/src/challenges/new-challenge.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ All the following pub unsafe functions must be annotated with safety contracts a
6161
| Weak<T:?Sized>::from_raw | alloc::sync |
6262
| Weak<T:?Sized,A:Allocator>::from_raw_in | alloc::sync |
6363

64-
These (not necessarily public) functions contain unsafe code in their bodies but are not themselves marked unsafe. At least 75% of these should be proven unconditionally safe, or safety contracts should be added.
64+
These (not necessarily public) functions contain unsafe code in their bodies but are not themselves marked unsafe. At least 75% of these should be proven unconditionally safe, or safety contracts should be added. From alloc::rc:
6565

6666
| Function | Location |
6767
|---------|---------|
@@ -120,6 +120,70 @@ These (not necessarily public) functions contain unsafe code in their bodies but
120120
| UniqueRcUninit<T:?Sized, A:Allocator>::data_ptr | alloc::rc |
121121
| Drop<T:?Sized, A:Allocator>::drop for UniqueRcUninit | alloc::rc |
122122

123+
And from alloc::sync:
124+
125+
| Function | Location |
126+
|---------|---------|
127+
| Arc<T:?Sized, A:Allocator>::into_inner_with_allocator | alloc::sync |
128+
| Arc<T>::new | alloc::sync |
129+
| Arc<T>::new_uninit | alloc::sync |
130+
| Arc<T>::new_zeroed | alloc::sync |
131+
| Arc<T>::pin | alloc::sync |
132+
| Arc<T>::try_pin | alloc::sync |
133+
| Arc<T>::try_new | alloc::sync |
134+
| Arc<T>::try_new_uninit | alloc::sync |
135+
| Arc<T>::try_new_zeroed | alloc::sync |
136+
| Arc<T,A:Allocator>::new_in | alloc::sync |
137+
| Arc<T,A:Allocator>::new_uninit_in | alloc::sync |
138+
| Arc<T,A:Allocator>::new_zeroed_in | alloc::sync |
139+
| Arc<T,A:Allocator>::new_cyclic_in | alloc::sync |
140+
| Arc<T,A:Allocator>::pin_in | alloc::sync |
141+
| Arc<T,A:Allocator>::try_pin_in | alloc::sync |
142+
| Arc<T,A:Allocator>::try_new_in | alloc::sync |
143+
| Arc<T,A:Allocator>::try_new_uninit_in | alloc::sync |
144+
| Arc<T,A:Allocator>::try_new_zeroed_in | alloc::sync |
145+
| Arc<T,A:Allocator>::try_unwrap | alloc::sync |
146+
| Arc<T,A:Allocator>::into_inner | alloc::sync |
147+
| Arc<[T]>::new_uninit_slice | alloc::sync |
148+
| Arc<[T]>::new_zeroed_slice | alloc::sync |
149+
| Arc<[T]>::into_array | alloc::sync |
150+
| Arc<[T],A:Allocator>::new_uninit_slice_in | alloc::sync |
151+
| Arc<[T],A:Allocator>::new_zeroed_slice_in | alloc::sync |
152+
| Arc<T:?Sized,A:Allocator>::into_raw_with_allocator | alloc::sync |
153+
| Arc<T:?Sized,A:Allocator>::as_ptr | alloc::sync |
154+
| Arc<T:?Sized,A:Allocator>::inner | alloc::sync |
155+
| Arc<T:?Sized,A:Allocator>::from_box_in | alloc::sync |
156+
| ArcFromSlice<T: Clone>::from_slice | alloc::sync |
157+
| ArcFromSlice<T: Copy>::from_slice | alloc::sync |
158+
| Clone<T: ?Sized, A:Allocator>::clone for Arc | alloc::sync |
159+
| Arc<T:?Sized+CloneToUninit, A:Allocator+Clone>::make_mut | alloc::sync |
160+
| Arc<T:?Sized, A:Allocator>::get_mut | alloc::sync |
161+
| Drop<T: ?Sized, A:Allocator>::drop for Arc | alloc::sync |
162+
| Arc<dyn Any+Send+Sync,A:Allocator>::downcast | alloc::sync |
163+
| Weak<T:?Sized,A:Allocator>::as_ptr | alloc::sync |
164+
| Weak<T:?Sized,A:Allocator>::into_raw_with_allocator | alloc::sync |
165+
| Weak<T:?Sized,A:Allocator>::upgrade | alloc::sync |
166+
| Weak<T:?Sized,A:Allocator>::inner | alloc::sync |
167+
| Drop<T:?Sized, A:Allocator>::drop for Weak | alloc::sync |
168+
| Default<T:Default>::default | alloc::sync |
169+
| Default<str>::default | alloc::sync |
170+
| Default<core::ffi::CStr>::default | alloc::sync |
171+
| Default<[T]>::default | alloc::sync |
172+
| From<&Str>::from | alloc::sync |
173+
| From<Vec<T,A:Allocator+Clone>>::from | alloc::sync |
174+
| From<Arc<str>>::from | alloc::sync |
175+
| TryFrom<Arc[T],A:Allocator>::try_from | alloc::sync |
176+
| ToArcSlice<T, I>::to_arc_slice | alloc::sync |
177+
| UniqueArcUninit<T:?Sized, A:Allocator>::new | alloc::sync |
178+
| UniqueArcUninit<T:?Sized, A:Allocator>::data_ptr | alloc::sync |
179+
| Drop<T:?Sized, A:Allocator>::drop for UniqueArcUninit | alloc::sync |
180+
| UniqueArc<T:?Sized,A:Allocator>::into_arc | alloc::sync |
181+
| UniqueArc<T:?Sized,A:Allocator+Clone>::downgrade | alloc::sync |
182+
| Deref<T:?Sized,A:Allocator>::deref | alloc::sync |
183+
| DerefMut<T:?Sized,A:Allocator>::deref_mut | alloc::sync |
184+
| Drop<T:?Sized, A:Allocator>::drop for UniqueArc | alloc::sync |
185+
186+
123187
(I haven't included non-public unsafe functions here, though I do include non-public functions that contain unsafe. Is that a problem? Also, need to add the Arc variants of all these.)
124188

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

0 commit comments

Comments
 (0)