rust/library
Michael Goulet c77dc28f87
Rollup merge of #125082 - kpreid:const-uninit, r=dtolnay
Remove `MaybeUninit::uninit_array()` and replace it with inline const blocks.

\[This PR originally contained the changes in #125995 too. See edit history for the original PR description.]

The documentation of `MaybeUninit::uninit_array()` says:

> Note: in a future Rust version this method may become unnecessary when Rust allows [inline const expressions](https://github.com/rust-lang/rust/issues/76001). The example below could then use `let mut buf = [const { MaybeUninit::<u8>::uninit() }; 32];`.

The PR adding it also said: <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];`

That time has come to pass — inline const expressions are stable — so `MaybeUninit::uninit_array()` is now unnecessary. The only remaining question is whether it is an important enough *convenience* to keep it around.

I believe it is net good to remove this function, on the principle that it is better to compose two orthogonal features (`MaybeUninit` and array construction) than to have a specific function for the specific combination, now that that is possible.
2024-06-24 15:51:01 -04:00
..
alloc Replace MaybeUninit::uninit_array() with array repeat expression. 2024-06-24 10:23:50 -07:00
backtrace@72265bea21 Update backtrace to 0.3.73 2024-06-06 22:50:45 -07:00
core Replace MaybeUninit::uninit_array() with array repeat expression. 2024-06-24 10:23:50 -07:00
panic_abort Stabilise c_unwind 2024-06-19 13:54:51 +01:00
panic_unwind Auto merge of #125853 - tesuji:promote-fail-fast, r=cjgillot 2024-06-21 16:00:14 +00:00
portable-simd Add blank lines after module-level //! comments. 2024-06-20 09:23:20 +10:00
proc_macro Add a hack to prevent proc_macro misopt in CI 2024-06-19 13:54:55 +01:00
profiler_builtins Update cc crate to v1.0.97 2024-05-08 15:06:35 +00:00
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #125082 - kpreid:const-uninit, r=dtolnay 2024-06-24 15:51:01 -04:00
stdarch@df3618d9f3 feat: update stdarch submodule for intrinsics on ARM 2024-05-15 15:38:58 -04:00
sysroot Add flag to sysroot 2024-05-11 14:31:55 +02:00
test Add blank lines after module-level //! comments. 2024-06-20 09:23:20 +10:00
unwind Stabilise c_unwind 2024-06-19 13:54:51 +01:00