Skip to content

ICE: thread 'rustc' panicked at 'unsized_part_of_type failed even though ty is unsized' #23370

Closed
@bitvoid

Description

@bitvoid

I just got an ICE while working on a testcase for another issue.

enum SomeEnum {
    Something(i8),
    SomethingElse([u8])
}

fn some_function(arg: &SomeEnum) -> () {
    ()
}

fn main() {
    some_function(&SomeEnum::Something(1));
}
<anon>:3:5: 3:24 warning: variant is never used: `SomethingElse`, #[warn(dead_code)] on by default
<anon>:3     SomethingElse([u8])
             ^~~~~~~~~~~~~~~~~~~
<anon>:6:18: 6:21 warning: unused variable: `arg`, #[warn(unused_variables)] on by default
<anon>:6 fn some_function(arg: &SomeEnum) -> () {
                          ^~~
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'unsized_part_of_type failed even though ty is unsized', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_trans/trans/common.rs:168


playpen: application terminated with error code 101

http://is.gd/qkbk29

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