rust/library/alloc
bors 663d2f5cd3 Auto merge of #75171 - amosonn:new_zeroed_slice, r=Amanieu
New zeroed slice

Add to #63291 the methods

```rust
impl<T> Box<[T]> { pub fn new_zeroed_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} }
impl<T> Rc<[T]> { pub fn new_zeroed_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} }
impl<T> Arc<[T]> { pub fn new_zeroed_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} }
```

as suggested in https://github.com/rust-lang/rust/issues/63291#issuecomment-605511675 .

Also optimize `{Rc, Arc}::new_zeroed` to use `alloc_zeroed`, otherwise they are no more efficient than using `new_uninit` and zeroing the memory manually (which was the original implementation).
2020-08-22 18:46:42 +00:00
..
benches Liballoc bench rename push_all extend_from_slice 2020-08-20 19:04:52 +08:00
src Auto merge of #75171 - amosonn:new_zeroed_slice, r=Amanieu 2020-08-22 18:46:42 +00:00
tests Move btree unit test to their native, privileged location 2020-08-14 17:54:09 +02:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00