Repository navigation
Add unsafe attributes and impls to tidy unsafety check - #163781
clarfonthey wants to merge 2 commits into
Conversation
54bf656 to
76cddd9
Compare
217f6d0 to
6ff92ca
Compare
6ff92ca to
d1865fc
Compare
|
|
d1865fc to
4ddc8cf
Compare
4ddc8cf to
bc54a4b
Compare
| impl<T, const N: usize, A: Allocator> FusedIterator for BoxedArrayIntoIter<T, N, A> {} | ||
|
|
||
| #[stable(feature = "boxed_array_value_iter", since = "1.99.0")] | ||
| // SAFETY: We just forward to `vec::IntoIter`, which has a trustable length. |
There was a problem hiding this comment.
We actually just take the raw length of the array here (see library/alloc/src/boxed/iter.rs:254)
|
|
||
| #[doc(hidden)] | ||
| #[unstable(issue = "none", feature = "trusted_fused")] | ||
| // SAFETY: We just forward to `vec::IntoIter`, which is always fused. |
There was a problem hiding this comment.
The only safety req on the trait is that the impl isn't lifetime-dependent (library/core/src/iter/traits/marker.rs:8)
| } | ||
|
|
||
| #[cfg(not(test))] | ||
| // SAFETY: We don't mutate the contained data when returning it. |
There was a problem hiding this comment.
The trait bounds here are kinda underspecified but I read the safety req (library/alloc/src/vec/in_place_collect.rs:428) as being something like "The internals of IntoIter promise never to mutate the data or create a reference to the entire allocation"
|
☔ The latest upstream changes (presumably #164187) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
This is another big one.
r? nia-e