1
Fork 0

Const-stabilize Vec::new.

This commit is contained in:
Mazdak Farrokhzad 2019-08-29 11:32:38 +02:00
parent b6269f27d9
commit d5fe5831ec
6 changed files with 33 additions and 17 deletions

View file

@ -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,
}
}