about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-01-27 04:43:37 +0900
committerGitHub <noreply@github.com>2021-01-27 04:43:37 +0900
commitb2f6c2aa9b0f87770b3160500cca2ae370aa618d (patch)
treeaf5df905c660b9ceda7a7b7b5c5b1d7eded76b48 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentd68570c78f698bd913bfc8dae33ebe81590457b7 (diff)
parentf52066726dd24ae07b1991b53f48ffa25c2b716d (diff)
downloadrust-b2f6c2aa9b0f87770b3160500cca2ae370aa618d.tar.gz
rust-b2f6c2aa9b0f87770b3160500cca2ae370aa618d.zip
Rollup merge of #81412 - hyd-dev:array-assume-init-wrong-assertion, 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 https://github.com/rust-lang/rust/pull/80600#discussion_r564496692.*

This PR makes it ignore zero-length arrays.

cc #80908
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions