b2f6c2aa9b
Fix assertion in `MaybeUninit::array_assume_init()` for zero-length arrays That assertion has a false positive ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=63922b8c897b04112adcdf346deb1d0e)): ```rust #![feature(maybe_uninit_array_assume_init)] use std::mem::MaybeUninit; enum Uninhabited {} fn main() { unsafe { // thread 'main' panicked at 'attempted to instantiate uninhabited type `Uninhabited`' MaybeUninit::<Uninhabited>::array_assume_init([]); } } ``` *Previously reported in https://github.com/rust-lang/rust/pull/80600#discussion_r564496692.* This PR makes it ignore zero-length arrays. cc #80908 |
||
---|---|---|
.. | ||
alloc | ||
backtrace@af078ecc0b | ||
core | ||
panic_abort | ||
panic_unwind | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@9c732a56f6 | ||
term | ||
test | ||
unwind |