The8472
a7a8b52e91
remove redundant cast
2020-09-03 20:59:28 +02:00
The8472
fe350dd82d
move unsafety into method, not relevant to caller
2020-09-03 20:59:27 +02:00
The8472
0d2d033415
replace unsafe ptr::write with deref-write, benchmarks show no difference
2020-09-03 20:59:26 +02:00
The8472
9596e5a2f2
pacify tidy
2020-09-03 20:59:26 +02:00
The8472
6ed05fd995
replace drop flag with ManuallyDrop
2020-09-03 20:59:25 +02:00
The8472
ab382b7661
mark as_inner as unsafe and update comments
2020-09-03 20:59:24 +02:00
The8472
2a51e579f5
avoid exposing that binary heap's IntoIter is backed by vec::IntoIter, use a private trait instead
2020-09-03 20:59:24 +02:00
The8472
e85cfa4f22
impl TrustedRandomAccess for vec::IntoIter
2020-09-03 20:59:22 +02:00
The8472
085eb20a61
move free-standing method into trait impl
2020-09-03 20:59:19 +02:00
The8472
00a32eb54f
fix some in-place-collect edge-cases
...
- it's an allocation optimization, so don't attempt to do it on ZSTs
- drop the tail of partially exhausted iters
2020-09-03 20:59:17 +02:00
The8472
8c816b96dd
remove redundant code
2020-09-03 20:59:16 +02:00
The8472
cc67c8eb91
improve comments
2020-09-03 20:59:16 +02:00
The8472
290fe895ba
specialize creating a Vec from a slice iterator where T: Copy
...
this was already implemented for Extend but not for FromIterator
2020-09-03 20:59:15 +02:00
The8472
dac0edfaaa
restore SpecFrom<T, TrustedLen<Item=T>> specialization by nesting
...
specializations
2020-09-03 20:59:15 +02:00
The8472
582fbb1d62
use From specializations on extend if extended Vec is empty
...
this enables in-place iteration and allocation reuse in additional cases
2020-09-03 20:59:14 +02:00
The8472
a4e385a0d0
use memmove instead of generic in-place iteration for IntoIter source
...
this is the original SpecExtend<_, IntoIter> logic except generalizing
the fast-path to include a memmove
2020-09-03 20:59:11 +02:00
The8472
631543dcb4
restore Vec::extend specialization for vec::IntoIter sources that
...
was lost during refactoring
2020-09-03 20:59:11 +02:00
The8472
232065074d
recover vectorization
...
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-03 20:59:09 +02:00
The8472
bead910b21
simplify pointer arithmetic
2020-09-03 20:59:08 +02:00
The8472
328a75f766
use add instead of offset
2020-09-03 20:59:07 +02:00
The8472
88b7ae642c
implement drop handling
2020-09-03 20:59:06 +02:00
The8472
73a982e9ec
assert that SourceIter requirements have not been violated by the pipeline
2020-09-03 20:59:06 +02:00
The8472
2a327394e4
mark SourceIter as unsafe, document invariants
2020-09-03 20:59:05 +02:00
The8472
bb2d533bb9
in-place collect for Vec. Box<[]> and BinaryHeap IntoIter and some adapters
2020-09-03 20:59:03 +02:00
The8472
076417e978
unrelated typo fix
2020-09-03 20:56:34 +02:00
Anton
b67006422e
Fix typos in vec try_reserve(_exact) docs
...
`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-09-02 13:12:44 +02:00
Aleksey Kladov
13c4f04561
Rollup merge of #76069 - pickfire:patch-16, r=jyn514
...
Use explicit intra-doc link in path for Vec resize
r? @jyn514
2020-08-31 12:51:53 +02:00
Aleksey Kladov
d829a5bcb1
Rollup merge of #76058 - pickfire:patch-11, r=jyn514
...
Use assertions on Vec doc
Clarify what the state of Vec after with_capacity on doc.
r? @jyn514
2020-08-31 12:51:51 +02:00
Aleksey Kladov
af1f46cf99
Rollup merge of #76055 - pickfire:patch-9, r=jyn514
...
Keep doc standard for Vec DrainFilter
r? @jyn514
2020-08-31 12:51:49 +02:00
Aleksey Kladov
e59eb4e0fa
Rollup merge of #76023 - pickfire:patch-4, r=jyn514
...
Liballoc extend use intra doc link
Superseeds https://github.com/rust-lang/rust/pull/75729/commits
r? @jyn514
2020-08-31 12:51:42 +02:00
Dylan DPC
75d6b109c2
Rollup merge of #75874 - pickfire:patch-3, r=jyn514
...
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-30 01:43:41 +02:00
Ivan Tham
2d1ab83834
Remove empty vec assertion flow distrupt
...
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-29 23:07:40 +08:00
Ivan Tham
be8b5eb529
Reuse description from drain_filter
...
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-29 22:39:34 +08:00
Ivan Tham
237c5005d6
Use explicit intra-doc link in path for Vec resize
2020-08-29 20:40:05 +08:00
Ivan Tham
12b4cf8c6c
Use assertions on Vec doc
...
Clarify what the state of Vec after with_capacity on doc.
2020-08-29 18:38:18 +08:00
Ivan Tham
d727442f2d
Remove brackets in drain filter docs
2020-08-29 18:23:29 +08:00
Ivan Tham
d504d553f1
Keep doc standard for Vec DrainFilter
2020-08-29 18:21:47 +08:00
Ivan Tham
c7e428e862
Liballoc vec doc use associated function
...
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-29 16:13:05 +08:00
Ivan Tham
2d6ab122b7
Liballoc extend use intra doc link
2020-08-28 19:33:53 +08:00
Ivan Tham
adc492573e
Shorten liballoc vec resize intra-doc link
2020-08-24 20:52:41 +08:00
Ivan Tham
bc7ea6f52e
Shorten liballoc doc intra link while readable
2020-08-24 20:02:02 +08:00
Josh Stone
f29f21285e
Rollup merge of #75672 - kofls:intradoc-fix, r=jyn514
...
Move to intra-doc links for task.rs and vec.rs
Partial fix for #75080
links for [`get`], [`get_mut`] skipped due to #75643
link for [`copy_from_slice`] skipped due to #63351
2020-08-20 10:07:19 -07:00
Surya Midatala
632db79ad6
Apply suggestions from code review
2020-08-19 10:29:31 +05:30
Josh Stone
7551f3fbbd
Don't panic in Vec::shrink_to_fit
2020-08-18 11:45:40 -07:00
Surya Midatala
11f69796ee
Move to intra-doc links for task.rs and vec.rs
2020-08-18 21:47:23 +05:30
Tyler Mandry
3111a8c1e2
Rollup merge of #74185 - pickfire:liballoc-iter-doc, r=jyn514
...
Remove liballoc unneeded explicit link
2020-08-14 14:46:40 -07:00
Ivan Tham
d2ecfcf21d
Update liballoc vec doc link
2020-08-14 10:52:09 +08:00
Ivan Tham
e0d215ff9e
Update src/liballoc/vec.rs
...
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-14 10:50:30 +08:00
Ivan Tham
dba647ef32
Remove liballoc unneeded explicit link
2020-08-14 10:50:30 +08:00
Ivan Tham
e4f2de2e9a
Fix range term in alloc vec doc
...
`range` is not an element, it is a variable.
2020-08-11 23:57:13 +08:00