about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-22 18:46:42 +0000
committerbors <bors@rust-lang.org>2020-08-22 18:46:42 +0000
commit663d2f5cd3163f17eddb74ee1e028d542255f21a (patch)
tree9fa6ffb91539e291d601c8ce585949a3ef830c0e /compiler/rustc_parse/src/parser/expr.rs
parent5528caf91442729b47b8f818be0a0ddfd0c17ffb (diff)
parent5aba816672d08a076eaa8005a109968af8ce1083 (diff)
downloadrust-663d2f5cd3163f17eddb74ee1e028d542255f21a.tar.gz
rust-663d2f5cd3163f17eddb74ee1e028d542255f21a.zip
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).
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
0 files changed, 0 insertions, 0 deletions