We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a56b09a commit c2eea98Copy full SHA for c2eea98
library/alloc/src/vec/mod.rs
@@ -3324,7 +3324,20 @@ where
3324
/// Creates an empty `Vec<T>`.
3325
///
3326
/// The vector will not allocate until elements are pushed onto it.
3327
- fn default() -> Vec<T, Global, CO_ALLOC_PREF> {
+ default fn default() -> Vec<T, Global, CO_ALLOC_PREF> {
3328
+ Vec::new_co()
3329
+ }
3330
+}
3331
+
3332
+#[stable(feature = "rust1", since = "1.0.0")]
3333
+#[rustc_const_unstable(feature = "const_default_impls", issue = "87864")]
3334
+#[allow(unused_braces)]
3335
+impl<T> const Default for Vec<T>
3336
+{
3337
+ /// Creates an empty `Vec<T>`.
3338
+ ///
3339
+ /// The vector will not allocate until elements are pushed onto it.
3340
+ fn default() -> Vec<T> {
3341
Vec::new_co()
3342
}
3343
0 commit comments