Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using enum with trait causes crash #29057

Closed
samueltardieu opened this issue Oct 14, 2015 · 2 comments
Closed

Using enum with trait causes crash #29057

samueltardieu opened this issue Oct 14, 2015 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@samueltardieu
Copy link
Contributor

The following code

trait U {}

enum T {
  Data(U)
}

fn f(t: &T) {}

fn main() {}

causes a crash:

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
thread 'rustc' panicked at 'Unexpected type returned from struct_tail: T for ty=T', ../src/librustc_trans/trans/type_of.rs:385
stack backtrace:
   1:     0x7f301ebbb2e0 - sys::backtrace::tracing::imp::write::h0d0a08d80e4d7818c6s
   2:     0x7f301ebc1bb5 - panicking::log_panic::_<closure>::closure.39237
   3:     0x7f301ebc1625 - panicking::log_panic::hc600c9d523508112r5w
   4:     0x7f301eb863d3 - sys_common::unwind::begin_unwind_inner::h11c2d7c7e9df27a1lZr
   5:     0x7f301eb86d38 - sys_common::unwind::begin_unwind_fmt::he0880dabecde94derYr
   6:     0x7f301e0aeb22 - trans::type_of::in_memory_type_of::h6d2f26d7ba580fbfDvN
   7:     0x7f301e0c1257 - trans::type_of::arg_type_of::h1b006958bb3a6c2a1tN
   8:     0x7f301e188bce - trans::type_of::type_of_rust_fn::h897c98922d866effVfN
   9:     0x7f301e0bb6be - trans::declare::declare_rust_fn::hbfcb86bdb2ca6dfe4oA
  10:     0x7f301e0e8825 - trans::base::register_fn::he5bb772f9d301465sZi
  11:     0x7f301e0ea471 - trans::base::register_method::hb2714a130f54c5c3Apj
  12:     0x7f301e0e2c7e - trans::base::get_item_val::h5682d3a912fe3768Tbj
  13:     0x7f301e0dfe05 - trans::base::trans_item::h1c07c6c08bf0df89mQi
  14:     0x7f301e0ed0a4 - trans::base::trans_crate::hca191217405132f4dCj
  15:     0x7f301f095d69 - driver::phase_4_translate_to_llvm::h299d4421665e611anPa
  16:     0x7f301f08fe76 - driver::phase_3_run_analysis_passes::_<closure>::closure.21872
  17:     0x7f301f07199c - middle::ty::context::_<impl>::create_and_enter::create_and_enter::h11954932776970334805
  18:     0x7f301f06d3dd - driver::phase_3_run_analysis_passes::h16794493593789304808
  19:     0x7f301f04bd67 - driver::compile_input::hb2545e07b739fd897ba
  20:     0x7f301f1a0f1b - run_compiler::h08f9725ff9bbf279Rpc
  21:     0x7f301f19e7a6 - boxed::_<impl>::call_box::call_box::h13709305409828408832
  22:     0x7f301f19e0b4 - sys_common::unwind::try::try_fn::try_fn::h15520752725335829705
  23:     0x7f301ebb9008 - __rust_try
  24:     0x7f301ebad78b - sys_common::unwind::try::inner_try::he824237455481e24TVr
  25:     0x7f301f19e24e - boxed::_<impl>::call_box::call_box::h3683904835642109356
  26:     0x7f301ebc0683 - sys::thread::_<impl>::new::thread_start::h21bf5aa61a8628b1Gnw
  27:     0x7f30182854a3 - start_thread
  28:     0x7f301e84e13c - clone
  29:                0x0 - <unknown>

Meta

% rustc --version --verbose
rustc 1.5.0-nightly (81b3b27cf 2015-10-11)
binary: rustc
commit-hash: 81b3b27cf533e50424f749d1c1db23e5d8db952f
commit-date: 2015-10-11
host: x86_64-unknown-linux-gnu
release: 1.5.0-nightly
@sfackler sfackler added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 14, 2015
@apasel422
Copy link
Contributor

This appears to be a duplicate of #16812.

@apasel422
Copy link
Contributor

This can be closed.

@arielb1 arielb1 closed this as completed Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants