]> git.lizzy.rs Git - rust.git/blobdiff - src/liballoc/vec.rs
make Vec::new const :P
[rust.git] / src / liballoc / vec.rs
index 7d1b2ed85c7e13655e871cdaff00be37796788d8..1d95f76fd7732b49acf9f55cc89795942a805318 100644 (file)
@@ -74,6 +74,7 @@
 use core::marker::PhantomData;
 use core::mem;
 #[cfg(not(test))]
+#[cfg(stage0)]
 use core::num::Float;
 use core::ops::Bound::{Excluded, Included, Unbounded};
 use core::ops::{Index, IndexMut, RangeBounds};
@@ -321,9 +322,9 @@ impl<T> Vec<T> {
     /// ```
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn new() -> Vec<T> {
+    pub const fn new() -> Vec<T> {
         Vec {
-            buf: RawVec::new(),
+            buf: RawVec::empty(),
             len: 0,
         }
     }