rust/library/alloc/src/vec
Dylan DPC 4ed8fa4759
Rollup merge of #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).
2022-08-22 20:34:16 +05:30
..
cow.rs Document From impls for cow.rs 2021-05-26 14:21:44 +00:00
drain.rs Rename unsigned_offset_from to sub_ptr 2022-05-11 17:16:25 -07:00
drain_filter.rs style: applying Rust style 2020-12-29 14:03:30 +00:00
in_place_collect.rs Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
in_place_drop.rs Rename unsigned_offset_from to sub_ptr 2022-05-11 17:16:25 -07:00
into_iter.rs Rollup merge of #100820 - WaffleLapkin:use_ptr_is_aligned_methods, r=scottmcm 2022-08-22 20:34:15 +05:30
is_zero.rs Support vec zero-alloc optimization for tuples and byte arrays 2022-07-24 15:56:39 -04:00
mod.rs Rollup merge of #100872 - JanBeh:PR_vec_default_alloc_doc, r=fee1-dead 2022-08-22 20:34:16 +05:30
partial_eq.rs Allow comparing Vecs with different allocators using == 2022-02-08 01:50:55 +00:00
set_len_on_drop.rs refactor: moved SetLenOnDrop to set_len_on_drop 2020-12-29 14:03:30 +00:00
spec_extend.rs Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
spec_from_elem.rs Support vec zero-alloc optimization for tuples and byte arrays 2022-07-24 15:56:39 -04:00
spec_from_iter.rs Update documentation of SpecFromIter to reflect the removed impls 2021-05-31 21:07:03 +02:00
spec_from_iter_nested.rs Improve estimation of capacity in Vec::from_iter 2022-01-19 09:47:49 -05:00
splice.rs Update expressions where we can use array's IntoIterator implementation 2021-06-02 16:09:04 +06:00