about summary refs log tree commit diff
path: root/compiler/rustc_llvm/src
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-06-05 01:14:33 -0700
committerGitHub <noreply@github.com>2024-06-05 01:14:33 -0700
commit6b6b698988111f16b535a8fae89c000dc00c26a2 (patch)
tree7f75b4e8eb34f85199654c312c097616dd6b28ae /compiler/rustc_llvm/src
parent448159c8e6728b63151b975733dc5b1714c8cea4 (diff)
parentec8fa177190f1f0279fade487dfa4cef23dd1101 (diff)
downloadrust-6b6b698988111f16b535a8fae89c000dc00c26a2.tar.gz
rust-6b6b698988111f16b535a8fae89c000dc00c26a2.zip
Rollup merge of #125995 - kpreid:const-uninit-stable, r=Nilstrieb
Use inline const blocks to create arrays of `MaybeUninit`.

This PR contains 2 changes enabled by the fact that [`inline_const` is now stable](https://github.com/rust-lang/rust/pull/104087), and was split out of #125082.

1. Use inline const instead of `unsafe` to construct arrays in `MaybeUninit` examples.

   Rationale: Demonstrate good practice of avoiding `unsafe` code where it is not strictly necessary.

4. Use inline const instead of `unsafe` to implement `MaybeUninit::uninit_array()`.

    This is arguably giving the compiler more work to do, in exchange for eliminating just one single internal unsafe block, so it's less certain that this is good on net.

r​? `@Nilstrieb`
Diffstat (limited to 'compiler/rustc_llvm/src')
0 files changed, 0 insertions, 0 deletions