Skip to content

ICE: reference to enum with unsized variant #36568

Closed
@hroi

Description

@hroi

Compiling this program results in an internal compiler error:

pub enum X {
    A([u8]),
}

pub fn crash(_: &X) {
}

fn main () {
}

Error:

error: internal compiler error: ../src/librustc_trans/type_of.rs:168: Unexpected tail in unsized_info_ty: X for ty=X

Meta

rustc --version --verbose:

rustc 1.13.0-nightly (32571c05c 2016-09-17)
binary: rustc
commit-hash: 32571c05c82c3b0fcb5d38afe03542226ca25d2d
commit-date: 2016-09-17
host: x86_64-apple-darwin
release: 1.13.0-nightly

Backtrace:

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:655
stack backtrace:
   1:        0x110d835ca - std::sys::backtrace::tracing::imp::write::h4b09e6e8c01db097
   2:        0x110d9a8df - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:        0x110d8fb9d - std::panicking::default_hook::h96c288d728df3ebf
   4:        0x110d90236 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:        0x110c4cc9a - std::panicking::begin_panic::hb7c71bbc491f561c
   6:        0x110c5d53a - rustc_errors::Handler::bug::h6a6af37ebad32a7a
   7:        0x10da01e3c - rustc::session::opt_span_bug_fmt::{{closure}}::h6ad7caa20ac20c4b
   8:        0x10d90ede9 - rustc::session::opt_span_bug_fmt::h38eb39636c07401c
   9:        0x10d90eb9a - rustc::session::bug_fmt::hd87c9038863af104
  10:        0x10cd09f8e - rustc_trans::type_of::unsized_info_ty::h132bf430b36779eb
  11:        0x10cd0a7d9 - rustc_trans::type_of::in_memory_type_of::hf0cd4d9282527edd
  12:        0x10cd19862 - rustc_trans::abi::FnType::unadjusted::{{closure}}::h5537ccf1f99ab669
  13:        0x10cc6e21f - rustc_trans::abi::FnType::unadjusted::h8793d87ae977adf3
  14:        0x10ccc57bb - rustc_trans::declare::declare_fn::hce6425d700e974bd
  15:        0x10cd0236b - rustc_trans::trans_item::TransItem::predefine::had5467b037998671
  16:        0x10cc824f5 - rustc_trans::base::trans_crate::h45437752c34c2c6e
  17:        0x10c955e31 - rustc_driver::driver::phase_4_translate_to_llvm::h1b8076dc9a7a3e1b
  18:        0x10c98f91f - rustc_driver::driver::compile_input::{{closure}}::hdf708031c67974d4
  19:        0x10c9819a2 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::hcac3a2328cd9259a
  20:        0x10c94e8b7 - rustc_driver::driver::phase_3_run_analysis_passes::h9865057b323cad0e
  21:        0x10c94143c - rustc_driver::driver::compile_input::hc0edbed7edb3eb18
  22:        0x10c96a348 - rustc_driver::run_compiler::h22d678d32fb7c300
  23:        0x10c8aa540 - std::panicking::try::do_call::h4d040997e2efdaf3
  24:        0x110d9ae9a - __rust_maybe_catch_panic
  25:        0x10c8c9e34 - <F as alloc::boxed::FnBox<A>>::call_box::hba0b436c79e56b23
  26:        0x110d8ee34 - std::sys::thread::Thread::new::thread_start::h022e3887023c6290
  27:     0x7fff8aecd99c - _pthread_body
  28:     0x7fff8aecd919 - _pthread_start

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions