rust/library/alloc/src
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
..
alloc Replace Memoryblock with NonNull<[u8]> 2020-08-04 18:03:34 +02:00
collections Apply suggestions from code review 2020-08-21 19:31:00 +02:00
prelude mv std libs to library/ 2020-07-27 19:51:13 -05:00
raw_vec Replace Memoryblock with NonNull<[u8]> 2020-08-04 18:03:34 +02:00
rc mv std libs to library/ 2020-07-27 19:51:13 -05:00
sync mv std libs to library/ 2020-07-27 19:51:13 -05:00
alloc.rs Use intra-doc-links in alloc 2020-08-21 00:25:25 +02:00
borrow.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
boxed.rs Auto merge of #75171 - amosonn:new_zeroed_slice, r=Amanieu 2020-08-22 18:46:42 +00:00
fmt.rs Apply suggestions from code review 2020-08-21 19:31:00 +02:00
lib.rs Use intra-doc-links in alloc 2020-08-21 00:25:25 +02:00
macros.rs Use intra-doc-links in alloc 2020-08-21 00:25:25 +02:00
raw_vec.rs Rollup merge of #75151 - pickfire:patch-4, r=LukasKalbertodt 2020-08-09 06:41:18 +09:00
rc.rs Auto merge of #75171 - amosonn:new_zeroed_slice, r=Amanieu 2020-08-22 18:46:42 +00:00
slice.rs Use intra-doc-links in alloc 2020-08-21 00:25:25 +02:00
str.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
string.rs Apply suggestions from code review 2020-08-21 19:31:00 +02:00
sync.rs Auto merge of #75171 - amosonn:new_zeroed_slice, r=Amanieu 2020-08-22 18:46:42 +00:00
task.rs Move to intra-doc links for task.rs and vec.rs 2020-08-18 21:47:23 +05:30
tests.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
vec.rs Rollup merge of #75672 - kofls:intradoc-fix, r=jyn514 2020-08-20 10:07:19 -07:00