Pavel Grigorenko
0d4259e68e
Add #[track_caller] to allocating methods of Vec & VecDeque
2024-09-20 01:20:10 +03:00
Nicholas Nethercote
84ac80f192
Reformat use declarations.
...
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00
Zachary S
0699345e7a
Remove lifetime bound for A for impl Extend<&'a T> for Vec<T, A>.
2023-07-01 02:12:45 -05:00
Scott McMurray
1c966e7f15
Extract the logic for TrustedLen to a named method that can be called directly
2022-11-24 03:12:05 -08:00
Maybe Waffle
e4720e1cf2
Replace most uses of pointer::offset with add and sub
2022-08-21 02:21:41 +04:00
Paolo Barbolini
c126f7fc8b
Add VecDeque::extend from vec::IntoIter and slice::Iter specializations
2022-04-28 06:13:54 +02:00
The8472
e0d70153cd
Add comments around code where ordering is important due for panic-safety
...
Iterators contain arbitrary code which may panic. Unsafe code has to be
careful to do its state updates at the right point between calls
that may panic.
2021-06-22 19:06:55 +02:00
The8472
f72c60a39a
Revert "Auto merge of #83770 - the8472:tra-extend, r=Mark-Simulacrum"
...
Due to a performance regression that didn't show up in the original perf run
this reverts commit 9111b8ae97 , reversing
changes made to 9a700d2947 .
2021-05-27 18:17:09 +02:00
bors
9111b8ae97
Auto merge of #83770 - the8472:tra-extend, r=Mark-Simulacrum
...
Add `TrustedRandomAccess` specialization for `Vec::extend()`
This should do roughly the same as the `TrustedLen` specialization but result in less IR by using `__iterator_get_unchecked`
instead of `Iterator::for_each`
Conflicting specializations are manually prioritized by grouping them under yet another helper trait.
2021-05-26 19:22:31 +00:00
Ivan Tham
eeac70c567
Merge same condition branch in vec spec_extend
2021-04-15 11:58:02 +08:00
The8472
020287516b
add TrustedRandomAccess specialization to vec::extend
...
This should do roughly the same as the TrustedLen specialization
but result in less IR by using __iterator_get_unchecked
instead of iterator.for_each.
2021-04-08 20:30:27 +02:00
The8472
ad3a791e2a
panic early when TrustedLen indicates a length > usize::MAX
2021-03-31 23:09:28 +02:00
C
2de8356f60
style: applying Rust style
2020-12-29 14:03:30 +00:00
C
bd49a60f29
refactor: moved SpecExtend into spec_extend.rs
2020-12-29 14:03:30 +00:00