Skip to content

LLVM Assertion failure with large fixed size array and default implementation #21044

@mrmonday

Description

@mrmonday

The following code:

#[derive(Copy)]
pub struct Foo {
    pub objs: [u8; 512us * 128us],
}
impl ::std::default::Default for Foo {
    fn default() -> Foo {
        unsafe {
            ::std::mem::zeroed()
        }
    }
}

When compiled with rustc --crate-type lib test.rs, gives the following error:

rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:899: llvm::SDValue::SDValue(llvm::SDNode*, unsigned int): Assertion `(!Node || ResNo < Node->getNumValues()) && "Invalid result number for the given node!"' failed.
zsh: abort (core dumped)  rustc /home/robert/rust-dpdk/src/lib.rs --crate-type lib

Rust version:

rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800

Using Linux x86_64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions