about summary refs log tree commit diff
path: root/library/alloc/src/collections/vec_deque/spec_extend.rs
AgeCommit message (Collapse)AuthorLines
2025-09-25Remove most `#[track_caller]` from allocating Vec methodsNoratrieb-6/+0
They cause significant binary size overhead while contributing little value. Also removes them from the wrapping String methods that do not panic.
2025-03-07Fully test the alloc crate through alloctestsbjorn3-0/+2
For the tests that make use of internal implementation details, we include the module to test using #[path] in alloctests now.
2024-09-20Add `#[track_caller]` to allocating methods of `Vec` & `VecDeque`Pavel Grigorenko-0/+6
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-07Specialize `TrustedLen` for `Iterator::unzip()`Chayim Refael Friedman-11/+2
Don't check the capacity every time (and also for `Extend` for tuples, as this is how `unzip()` is implemented). I did this with an unsafe method on `Extend` that doesn't check for growth (`extend_one_unchecked()`). I've marked it as perma-unstable currently, although we may want to expose it in the future so collections outside of std can benefit from it. Then specialize `Extend for (A, B)` for `TrustedLen` to call it. It may seem that an alternative way of implementing this is to have a semi-public trait (`#[doc(hidden)]` public, so collections outside of core can implement it) for `extend()` inside tuples, and specialize it from collections. However, it is impossible due to limitations of `min_specialization`. A concern that may arise with the current approach is that implementing `extend_one_unchecked()` correctly must also incur implementing `extend_reserve()`, otherwise you can have UB. This is a somewhat non-local safety invariant. However, I believe this is fine, since to have actual UB you must have unsafe code inside your `extend_one_unchecked()` that makes incorrect assumption, *and* not implement `extend_reserve()`. I've also documented this requirement.
2022-11-26Don't use `Take` in `SpecExtend` implMarkus Everling-21/+23
2022-11-25Changes according to code reviewMarkus Everling-5/+6
2022-11-20Update VecDeque implementationMarkus Everling-42/+30
2022-06-18Expose iter::ByRefSized as unstable feature and use itPaolo Barbolini-1/+1
2022-06-18Add VecDeque::extend from TrustedLen specializationPaolo Barbolini-0/+59
2022-04-28Add VecDeque::extend from vec::IntoIter and slice::Iter specializationsPaolo Barbolini-0/+73