rust/library/alloc
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
..
benches Reorder benches const variable 2020-09-29 21:39:24 +08:00
src Rollup merge of #81706 - SkiFire13:document-binaryheap-unsafe, r=Mark-Simulacrum 2021-02-21 15:26:40 +09:00
tests Added tests to drain an empty vec 2021-02-13 11:18:36 +08:00
Cargo.toml Update compiler_builtins to 0.1.39 2021-01-07 16:16:36 +09:00