about summary refs log tree commit diff
path: root/library/alloc/src/vec.rs
AgeCommit message (Collapse)AuthorLines
2020-09-03Link to `#capacity-and-reallocation` when using with_capacityJoshua Nelson-0/+3
2020-09-03fix debug assertionThe8472-4/+18
The InPlaceIterable debug assert checks that the write pointer did not advance beyond the read pointer. But TrustedRandomAccess never advances the read pointer, thus triggering the assert. Skip the assert if the source pointer did not change during iteration.
2020-09-03improve comments and namingThe8472-25/+56
2020-09-03add explanation to specialization markerThe8472-0/+6
2020-09-03remove separate no-drop code path since it resulted in more LLVM IRThe8472-32/+15
2020-09-03remove empty Vec extend optimizationThe8472-14/+2
The optimization meant that every extend code path had to emit llvm IR for from_iter and extend spec_extend, which likely impacts compile times while only improving a few edge-cases
2020-09-03get things to work under min_specialization by leaning more heavily on ↵The8472-8/+13
#[rustc_unsafe_specialization_marker]
2020-09-03apply required min_specialization attributesThe8472-1/+7
2020-09-03generalize in-place collect to types of same size and alignmentThe8472-19/+27
2020-09-03increase comment verbosityThe8472-2/+2
2020-09-03work around compiler overhead around lambdas in generics by extracting them ↵The8472-34/+39
into free functions
2020-09-03extract IntoIter drop/forget used by specialization into separate methodsThe8472-15/+25
2020-09-03remove redundant castThe8472-1/+1
2020-09-03move unsafety into method, not relevant to callerThe8472-2/+2
2020-09-03replace unsafe ptr::write with deref-write, benchmarks show no differenceThe8472-10/+4
2020-09-03pacify tidyThe8472-3/+3
2020-09-03replace drop flag with ManuallyDropThe8472-6/+4
2020-09-03mark as_inner as unsafe and update commentsThe8472-4/+8
2020-09-03avoid exposing that binary heap's IntoIter is backed by vec::IntoIter, use a ↵The8472-5/+16
private trait instead
2020-09-03impl TrustedRandomAccess for vec::IntoIterThe8472-1/+22
2020-09-03move free-standing method into trait implThe8472-79/+75
2020-09-03fix some in-place-collect edge-casesThe8472-0/+13
- it's an allocation optimization, so don't attempt to do it on ZSTs - drop the tail of partially exhausted iters
2020-09-03remove redundant codeThe8472-7/+1
2020-09-03improve commentsThe8472-7/+10
2020-09-03specialize creating a Vec from a slice iterator where T: CopyThe8472-0/+14
this was already implemented for Extend but not for FromIterator
2020-09-03restore SpecFrom<T, TrustedLen<Item=T>> specialization by nestingThe8472-1/+29
specializations
2020-09-03use From specializations on extend if extended Vec is emptyThe8472-3/+25
this enables in-place iteration and allocation reuse in additional cases
2020-09-03use memmove instead of generic in-place iteration for IntoIter sourceThe8472-2/+10
this is the original SpecExtend<_, IntoIter> logic except generalizing the fast-path to include a memmove
2020-09-03restore Vec::extend specialization for vec::IntoIter sources thatThe8472-0/+9
was lost during refactoring
2020-09-03recover vectorizationThe8472-23/+53
switch to try_fold and segregate the drop handling to keep collect::<Vec<u8>>() and similar optimizer-friendly It comes at the cost of less accurate debug_asserts and code complexity
2020-09-03simplify pointer arithmeticThe8472-11/+15
2020-09-03use add instead of offsetThe8472-1/+1
2020-09-03implement drop handlingThe8472-7/+26
2020-09-03assert that SourceIter requirements have not been violated by the pipelineThe8472-0/+2
2020-09-03mark SourceIter as unsafe, document invariantsThe8472-1/+1
2020-09-03in-place collect for Vec. Box<[]> and BinaryHeap IntoIter and some adaptersThe8472-41/+97
2020-09-03unrelated typo fixThe8472-1/+1
2020-09-03Link & primitive using relative linkIvan Tham-0/+1
2020-09-02Fix typos in vec try_reserve(_exact) docsAnton-3/+3
`try_reserve` and `try_reserve_exact` docs refer to calling `reserve` and `reserve_exact`. `try_reserve_exact` example uses `try_reserve` method instead of `try_reserve_exact`.
2020-08-31Rollup merge of #76069 - pickfire:patch-16, r=jyn514Aleksey Kladov-3/+1
Use explicit intra-doc link in path for Vec resize r? @jyn514
2020-08-31Rollup merge of #76058 - pickfire:patch-11, r=jyn514Aleksey Kladov-2/+3
Use assertions on Vec doc Clarify what the state of Vec after with_capacity on doc. r? @jyn514
2020-08-31Rollup merge of #76055 - pickfire:patch-9, r=jyn514Aleksey Kladov-1/+4
Keep doc standard for Vec DrainFilter r? @jyn514
2020-08-31Rollup merge of #76023 - pickfire:patch-4, r=jyn514Aleksey Kladov-1/+1
Liballoc extend use intra doc link Superseeds https://github.com/rust-lang/rust/pull/75729/commits r? @jyn514
2020-08-30Try removing [prim@reference]Ivan Tham-1/+1
2020-08-30Rollup merge of #75874 - pickfire:patch-3, r=jyn514Dylan DPC-3/+1
Shorten liballoc doc intra link while readable r? @jyn514 Do you want to reviews these sort of pull requests in the future? I might send a few of them while reading vec code.
2020-08-29Remove empty vec assertion flow distruptIvan Tham-1/+0
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-29Reuse description from drain_filterIvan Tham-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-29Use explicit intra-doc link in path for Vec resizeIvan Tham-3/+1
2020-08-29Vec slice example fix style and show type elisionIvan Tham-1/+1
2020-08-29Link vec doc to & referenceIvan Tham-1/+1
It is not always obvious that people could see the docs for `&` especially for beginners, it also helps learnability.