diff options
| author | Ralf Jung <post@ralfj.de> | 2019-07-19 10:44:11 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-07-19 14:47:56 +0200 |
| commit | e074db764a0f25af073cb3f472d39a86e6fa7f39 (patch) | |
| tree | 6d0263f84567761ea6e65dd81f1c92bd9e7299e3 /src/liballoc | |
| parent | fe499a7b34dcb1fc054dd637ea561a19a268d2de (diff) | |
| download | rust-e074db764a0f25af073cb3f472d39a86e6fa7f39.tar.gz rust-e074db764a0f25af073cb3f472d39a86e6fa7f39.zip | |
use const array repeat expressions for uninit_array
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/collections/btree/node.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs index 7cf077d61d6..e067096f0c7 100644 --- a/src/liballoc/collections/btree/node.rs +++ b/src/liballoc/collections/btree/node.rs @@ -106,8 +106,8 @@ impl<K, V> LeafNode<K, V> { LeafNode { // As a general policy, we leave fields uninitialized if they can be, as this should // be both slightly faster and easier to track in Valgrind. - keys: uninitialized_array![_; CAPACITY], - vals: uninitialized_array![_; CAPACITY], + keys: uninit_array![_; CAPACITY], + vals: uninit_array![_; CAPACITY], parent: ptr::null(), parent_idx: MaybeUninit::uninit(), len: 0 @@ -159,7 +159,7 @@ impl<K, V> InternalNode<K, V> { unsafe fn new() -> Self { InternalNode { data: LeafNode::new(), - edges: uninitialized_array![_; 2*B], + edges: uninit_array![_; 2*B], } } } diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 2e48825e81c..68df0137ee6 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -77,6 +77,7 @@ #![feature(box_syntax)] #![feature(cfg_target_has_atomic)] #![feature(coerce_unsized)] +#![cfg_attr(not(bootstrap), feature(const_in_array_repeat_expressions))] #![feature(dispatch_from_dyn)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] |
