rust/library/alloc/src/vec
Kevin Reid 13fca73f49 Replace MaybeUninit::uninit_array() with array repeat expression.
This is possible now that inline const blocks are stable; the idea was
even mentioned as an alternative when `uninit_array()` was added:
<https://github.com/rust-lang/rust/pull/65580#issuecomment-544200681>

> if it’s stabilized soon enough maybe it’s not worth having a
> standard library method that will be replaceable with
> `let buffer = [MaybeUninit::<T>::uninit(); $N];`

Const array repetition and inline const blocks are now stable (in the
next release), so that circumstance has come to pass, and we no longer
have reason to want `uninit_array()` other than convenience. Therefore,
let’s evaluate the inconvenience by not using `uninit_array()` in
the standard library, before potentially deleting it entirely.
2024-06-24 10:23:50 -07:00
..
cow.rs Bump version placeholders 2024-02-08 07:43:38 -05:00
drain.rs enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
extract_if.rs remove unused field 2023-06-15 21:14:40 +02:00
in_place_collect.rs Add blank lines after module-level //! comments. 2024-06-20 09:23:20 +10:00
in_place_drop.rs Avoid more NonNull-raw-NonNull roundtrips in Vec 2024-04-12 18:14:29 -04:00
into_iter.rs Replace MaybeUninit::uninit_array() with array repeat expression. 2024-06-24 10:23:50 -07:00
is_zero.rs Use generic NonZero everywhere in alloc. 2024-02-22 15:17:34 +01:00
mod.rs replace version placeholder 2024-06-11 16:52:02 +02:00
partial_eq.rs Allow comparing Vecs with different allocators using == 2022-02-08 01:50:55 +00:00
set_len_on_drop.rs Tune RepeatWith::try_fold and Take::for_each and Vec::extend_trusted 2022-11-24 19:14:19 -08:00
spec_extend.rs Remove lifetime bound for A for impl Extend<&'a T> for Vec<T, A>. 2023-07-01 02:12:45 -05:00
spec_from_elem.rs docs(GH-118094): make docs a bit more explicit 2023-11-20 18:35:04 +03:00
spec_from_iter.rs Avoid more NonNull-raw-NonNull roundtrips in Vec 2024-04-12 18:14:29 -04:00
spec_from_iter_nested.rs Improve estimation of capacity in Vec::from_iter 2022-01-19 09:47:49 -05:00
splice.rs enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00