rust/library/alloc/src/collections
Yuki Okushi 56ae3fb2f0
Rollup merge of #81706 - SkiFire13:document-binaryheap-unsafe, r=Mark-Simulacrum
Document BinaryHeap unsafe functions

`BinaryHeap` contains some private safe functions but that are actually unsafe to call. This PR marks them `unsafe` and documents all the `unsafe` function calls inside them.

While doing this I might also have found a bug: some "SAFETY" comments in `sift_down_range` and `sift_down_to_bottom` are valid only if you assume that `child` doesn't overflow. However it may overflow if `end > isize::MAX` which can be true for ZSTs (but I think only for them). I guess the easiest fix would be to skip any sifting if `mem::size_of::<T> == 0`.

Probably conflicts with #81127 but solving the eventual merge conflict should be pretty easy.
2021-02-21 15:26:40 +09:00
..
btree Rollup merge of #81300 - ssomers:btree_cleanup_leak_tests, r=Mark-Simulacrum 2021-02-21 15:26:36 +09:00
linked_list Remove linked_list_extras methods. 2020-08-01 00:54:22 +08:00
vec_deque shrink_to shouldn't panic on len greater than capacity 2021-01-26 19:25:37 +01:00
binary_heap.rs Add FIXME for safety comments that are invalid when T is a ZST 2021-02-20 15:44:17 -05:00
linked_list.rs Add "length" as doc alias to len methods 2020-12-28 09:13:46 +01:00
mod.rs Rename LayoutErr to LayoutError outside of core 2020-10-08 00:40:10 -04:00