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 |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |