about summary refs log tree commit diff
path: root/src/liballoc/vec.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-09-16 17:09:34 +0200
committerGitHub <noreply@github.com>2019-09-16 17:09:34 +0200
commitbe327a8f692919fd26742e6b88918878f67d60dd (patch)
treee19cbb400b987b43bb86402085db3ca10d11c9f9 /src/liballoc/vec.rs
parentf432d5030ed4c16932cab88bbf71175cd285a03b (diff)
parent9b3e11f635c0354040ce515ac0ed4fade6fe928f (diff)
downloadrust-be327a8f692919fd26742e6b88918878f67d60dd.tar.gz
rust-be327a8f692919fd26742e6b88918878f67d60dd.zip
Rollup merge of #64028 - Centril:stabilize-alloc-new-2, r=alexcrichton
Stabilize `Vec::new` and `String::new` as `const fn`s

Closes https://github.com/rust-lang/rust/issues/64022.

r? @oli-obk
Diffstat (limited to 'src/liballoc/vec.rs')
-rw-r--r--src/liballoc/vec.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index c513658c842..405969a550b 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -314,10 +314,10 @@ impl<T> Vec<T> {
     /// ```
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_vec_new")]
+    #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_vec_new"))]
     pub const fn new() -> Vec<T> {
         Vec {
-            buf: RawVec::new(),
+            buf: RawVec::NEW,
             len: 0,
         }
     }