Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#81412 - hyd-dev:array-assume-init-wrong-ass…
…ertion, r=m-ou-se 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 rust-lang#80600 (comment) This PR makes it ignore zero-length arrays. cc rust-lang#80908
- Loading branch information