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

the compiler unexpectedly panicked when unboxed trait is used in Enum #29160

Closed
hyunsik opened this issue Oct 19, 2015 · 1 comment
Closed

the compiler unexpectedly panicked when unboxed trait is used in Enum #29160

hyunsik opened this issue Oct 19, 2015 · 1 comment

Comments

@hyunsik
Copy link

hyunsik commented Oct 19, 2015

The reproduction code is as the following. DataSet in Plan enum should be enclosed by Box, but I missed it. In this case, rustc should have caused the compilation error as far as I know. But, it causes compiler panic.

pub trait DataSet: Display {
  fn bind(&mut self) -> Void;  
  fn name(&self) -> &str;
...

pub enum Plan {
  From (DataSet),
  Select(Box<Plan>, Vec<Expr>), // params: child, filter in a CNF form
...

pub struct DataFrame<'a> {
  pub ctx : &'a TokamakContext,
  pub plan: Plan
}

pub fn from<'a, T: DataSet + 'a>(&'a self, ds: T) -> DataFrame<'a> {
    DataFrame {ctx: self, plan: Plan::From(ds)}
}

Meta

rustc --version --verbose:

rustc 1.5.0-nightly (206af38e7 2015-10-17)
binary: rustc
commit-hash: 206af38e74ce7fa4b0e781ece7f1067c018c580e
commit-date: 2015-10-17
host: x86_64-unknown-linux-gnu
release: 1.5.0-nightly

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
thread 'rustc' panicked at 'Unexpected type returned from struct_tail: common::plan::Plan for ty=common::plan::Plan', ../src/librustc_trans/trans/type_of.rs:385
stack backtrace:
   1:     0x7f0ec0b7ab80 - sys::backtrace::tracing::imp::write::hc9cd4475e839602bcet
   2:     0x7f0ec0b81455 - panicking::log_panic::_<closure>::closure.39375
   3:     0x7f0ec0b80ec5 - panicking::log_panic::h590c92fc0a4ce7d8kex
   4:     0x7f0ec0b45a93 - sys_common::unwind::begin_unwind_inner::h613f56b60805f050g7r
   5:     0x7f0ec0b463f8 - sys_common::unwind::begin_unwind_fmt::h1bc638525cf6f9f1m6r
   6:     0x7f0ec0048f32 - trans::type_of::in_memory_type_of::h861e6ec0299bb850QyN
   7:     0x7f0ec005b667 - trans::type_of::arg_type_of::he94d012163516b74exN
   8:     0x7f0ec0121c4e - trans::type_of::type_of_rust_fn::h58bc5d6bbfb81b978iN
   9:     0x7f0ec0055ace - trans::declare::declare_rust_fn::hca2ab4ed8541921dKrA
  10:     0x7f0ec0083855 - trans::base::register_fn::h4ea61b21d03fafc9KZi
  11:     0x7f0ec007df09 - trans::base::get_item_val::h1e00603cd1bd358ebcj
  12:     0x7f0ec0079f89 - trans::base::trans_item::hf20ffb9e34f45149EQi
  13:     0x7f0ec007ab18 - trans::base::trans_item::hf20ffb9e34f45149EQi
  14:     0x7f0ec0087f94 - trans::base::trans_crate::h7f9be4f55fb77deexCj
  15:     0x7f0ec10568e9 - driver::phase_4_translate_to_llvm::ha38fc904a5b65c96rPa
  16:     0x7f0ec10509f6 - driver::phase_3_run_analysis_passes::_<closure>::closure.21866
  17:     0x7f0ec103251c - middle::ty::context::_<impl>::create_and_enter::create_and_enter::h1581818717133174881
  18:     0x7f0ec102df5d - driver::phase_3_run_analysis_passes::h14363318041318723032
  19:     0x7f0ec100ec4c - driver::compile_input::h7429410b945488fe7ba
  20:     0x7f0ec115d3eb - run_compiler::h9bfa87b2a333b60e0pc
  21:     0x7f0ec115ac76 - boxed::_<impl>::call_box::call_box::h14045816518007926184
  22:     0x7f0ec115a584 - sys_common::unwind::try::try_fn::try_fn::h13580444196100517801
  23:     0x7f0ec0b788a8 - __rust_try
  24:     0x7f0ec0b6d02b - sys_common::unwind::try::inner_try::hbe40bc0f15f0f398O3r
  25:     0x7f0ec115a71e - boxed::_<impl>::call_box::call_box::h3999059919301623319
  26:     0x7f0ec0b7ff23 - sys::thread::_<impl>::new::thread_start::h6db8a86c0e97df0byww
  27:     0x7f0eba2276a9 - start_thread
  28:     0x7f0ec0804eec - clone
  29:                0x0 - <unknown>
@apasel422
Copy link
Contributor

This is a duplicate of #29057 and #16812.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants