The8472
f1c588f1ef
use fold instead of try_fold now that .by_ref().next() has been inlined
2021-10-11 23:36:04 +02:00
Aman Arora
994793faab
PR fixup
2021-09-22 05:17:30 -04:00
Aman Arora
099a34cd95
2229: Annotate stdlib with insignficant dtors
2021-09-21 04:06:00 -04:00
Mara Bos
5ea45f35c0
Update outdated docs of array::IntoIter::new.
2021-09-03 11:24:52 +02:00
Frank Steffahn
be9d2699ca
Fix more “a”/“an” typos
2021-08-22 16:35:29 +02:00
The8472
2276c5e3d7
from review: add a comment why try_fold was chosen instead of fold
2021-07-27 00:14:19 +02:00
The8472
e015e9da71
implement fold() on array::IntoIter to improve flatten().collect() perf
...
```
# old
test vec::bench_flat_map_collect ... bench: 2,244,024 ns/iter (+/- 18,903)
# new
test vec::bench_flat_map_collect ... bench: 172,863 ns/iter (+/- 2,141)
```
2021-07-24 19:24:11 +02:00
Frank Steffahn
1b66a799c7
Remove unsound TrustedRandomAccess implementations
...
Removes the implementations that depend on the user-definable trait `Copy`.
Only fix regressions to ensure merge in 1.55: Does not modify `vec::IntoIter`.
2021-07-21 14:37:23 +02:00
Jacob Hoffman-Andrews
910c7fa767
Add doc(hidden) to all __iterator_get_unchecked
...
This method on the Iterator trait is doc(hidden), and about half of
implementations were doc(hidden). This adds the attribute to the
remaining implementations.
2021-06-16 22:08:44 -07:00
BlackHoleFox
d1b69cf89b
Fix typo in core::array::IntoIter comment
2021-05-26 02:37:39 -05:00
Josh Stone
3b1f5e3462
Use iter::zip in library/
2021-03-26 09:32:29 -07:00
The8472
08a1dd287d
implement TrustedRandomAccess for array::IntoIter
2021-03-21 20:43:48 +01:00
Joshua Nelson
9a75f4fed1
Convert primitives to use intra-doc links
2021-02-25 20:31:53 -05:00
Simon Sapin
83d32b0a27
Add example to array::IntoIter::new’s doc-comment
...
Co-authored-by: Ashley Mannix <kodraus@hey.com >
2021-01-21 15:52:53 +01:00
Simon Sapin
61c49d4042
Stabilize by-value [T; N] iterator core::array::IntoIter
...
Tracking issue: https://github.com/rust-lang/rust/issues/65798
This is unblocked now that `min_const_generics` has been stabilized
in https://github.com/rust-lang/rust/pull/79135 .
This PR does *not* include the corresponding `IntoIterator` impl,
which is https://github.com/rust-lang/rust/pull/65819 .
Instead, an iterator can be constructed through the `new` method.
`new` would become unnecessary when `IntoIterator` is implemented
and might be deprecated then, although it will stay stable.
2020-12-29 09:16:46 +01:00
est31
de08df26d3
Make as{_mut,}_slice on array::IntoIter public
2020-11-19 08:28:49 +01:00
Mara Bos
a14efd1d0a
Rename MaybeUninit::read to assume_init_read.
2020-09-09 11:27:42 +02:00
Ralf Jung
cff5f56886
rename MaybeUninit slice methods
...
first_ptr -> slice_as_ptr
first_ptr_mut -> slice_as_mut_ptr
slice_get_ref -> slice_assume_init_ref
slice_get_mut -> slice_assume_init_mut
2020-09-05 17:24:22 +02:00
Josh Stone
a2cfc74c5f
Simplify array::IntoIter
...
- Initialization can use `transmute_copy` to do the bitwise copy.
- `as_slice` can use `get_unchecked` and `MaybeUninit::slice_get_ref`,
and `as_mut_slice` can do similar.
- `next` and `next_back` can use the corresponding `Range` methods.
- `Clone` doesn't need any unsafety, and we can dynamically update the
new range to get partial drops if `T::clone` panics.
2020-08-07 13:51:46 -07:00
mark
2c31b45ae8
mv std libs to library/
2020-07-27 19:51:13 -05:00