Const-stabilize Vec::new
.
This commit is contained in:
parent
b6269f27d9
commit
d5fe5831ec
6 changed files with 33 additions and 17 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue