rust/library/alloc/src
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
..
alloc Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
collections Rollup merge of #81706 - SkiFire13:document-binaryheap-unsafe, r=Mark-Simulacrum 2021-02-21 15:26:40 +09:00
prelude mv std libs to library/ 2020-07-27 19:51:13 -05:00
raw_vec Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
rc Re-stabilize Weak::as_ptr &friends for unsized T 2021-01-06 19:30:22 -05:00
sync Rollup merge of #80764 - CAD97:weak-unsized-as-ptr-again, r=RalfJung 2021-01-16 17:29:56 +00:00
vec Rollup merge of #81811 - schteve:fix_vec_retain_doc_test, r=m-ou-se 2021-02-13 16:36:40 +09:00
alloc.rs move WriteCloneIntoRaw into alloc::alloc 2021-01-12 12:24:28 -08:00
borrow.rs Mention Arc::make_mut and Rc::make_mut in the documentation of Cow 2020-12-28 17:13:28 +01:00
boxed.rs Remove unnecessary lint allow attrs on example 2021-02-12 12:46:02 +03:00
fmt.rs Improve grammar in documentation of format strings 2021-01-01 23:07:35 +01:00
lib.rs Rollup merge of #81526 - ojeda:btree-use-unwrap_unchecked, r=scottmcm 2021-02-07 14:45:46 +01:00
macros.rs Auto merge of #79233 - yoshuawuyts:alloc-doc-alias, r=GuillaumeGomez 2021-01-22 21:48:41 +00:00
raw_vec.rs Auto merge of #79113 - andjo403:raw_vec_ptr, r=m-ou-se 2021-01-26 02:56:37 +00:00
rc.rs Add docs for shared_from_slice From impls 2021-02-12 14:02:23 -07:00
slice.rs Replace the tracking issue for the slice_group_by feature 2020-12-31 12:13:03 +01:00
str.rs Remove many unnecessary manual link resolves from library 2020-12-31 11:54:32 -08:00
string.rs Fix small typo 2021-01-31 12:19:09 +01:00
sync.rs Add docs for shared_from_slice From impls 2021-02-12 14:02:23 -07:00
task.rs Stabilize the Wake trait 2021-02-03 16:54:29 +01:00
tests.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00