Skip to content

Taking a reference to a static with an extern type ICEs #57876

Closed
@mehcode

Description

@mehcode

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=19c98852cf33b7b65ec942629c6ced44

#![feature(extern_types)]

extern "C" {
    type Foo;
    static FOO: Foo;
}

fn main() {
    let foo = unsafe { &FOO };
}

thread 'rustc' panicked at 'assertion failed: !layout.is_unsized()', src/librustc_codegen_ssa/mir/place.rs:35:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-nightly (7bac68a5d 2019-01-21) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

$ rustc -V
rustc 1.33.0-nightly (7bac68a5d 2019-01-21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions