This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 4ed8fa4
authored
Rollup merge of rust-lang#100872 - JanBeh:PR_vec_default_alloc_doc, r=fee1-dead
Add guarantee that Vec::default() does not alloc
Currently `Vec::new()` is guaranteed to not allocate until elements are pushed onto the `Vec`, but such a guarantee is missing for `Vec`'s implementation of `Default::default`.
This adds such a guarantee for `Vec::default()` to the API reference.
See also [this discussion on URLO](https://users.rust-lang.org/t/guarantee-that-vec-default-does-not-allocate/79903).1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2928 | 2928 | | |
2929 | 2929 | | |
2930 | 2930 | | |
| 2931 | + | |
| 2932 | + | |
2931 | 2933 | | |
2932 | 2934 | | |
2933 | 2935 | | |
| |||
0 commit comments