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

ICE on implementing a trait with an extern "rust-call" function #19397

Closed
ftxqxd opened this issue Nov 29, 2014 · 5 comments
Closed

ICE on implementing a trait with an extern "rust-call" function #19397

ftxqxd opened this issue Nov 29, 2014 · 5 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ftxqxd
Copy link
Contributor

ftxqxd commented Nov 29, 2014

trait Foo {
    extern "rust-call" fn foo();
}

impl Foo for () {
    extern "rust-call" fn foo() {}
}

fn main() {}
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustc_trans/lib.rs:1

stack backtrace:
   1:     0x7f026d48e3b0 - rt::backtrace::imp::write::h753be74b825f61ed19x
   2:     0x7f026d491480 - failure::on_fail::h7418e5cabf6c549ekCy
   3:     0x7f026d0e7320 - unwind::begin_unwind_inner::h21b15480bba8536c0Qc
   4:     0x7f026d0e6f60 - unwind::begin_unwind_fmt::ha54d70607579ef16bOc
   5:     0x7f026d0e6f20 - rust_begin_unwind
   6:     0x7f026d12c7e0 - panicking::panic_fmt::h144ed295ee75bac8VXl
   7:     0x7f026d131c20 - panicking::panic_bounds_check::h46462e0c27f8d7d1tWl
   8:     0x7f026d9e7650 - trans::base::get_fn_llvm_attributes::hc0b3d585a75ed3e7jkv
   9:     0x7f026d9e6410 - trans::base::decl_rust_fn::hdb49e69d8957a677rCs
  10:     0x7f026d9fccf0 - trans::base::register_fn::hac5d473a4e5c818bxiv
  11:     0x7f026d9ff890 - trans::base::register_method::he6d8d1dc781b7af2cZv
  12:     0x7f026d933d70 - trans::base::get_item_val::h07c1542a8cc17e2c7Gv
  13:     0x7f026d9faa00 - trans::meth::trans_impl::h7ce660493050c3ceX8z
  14:     0x7f026d932690 - trans::base::trans_item::h4f3b35bce9ae51243av
  15:     0x7f026d9fb160 - trans::base::trans_mod::h18114d50e28ae38eygv
  16:     0x7f026da01f80 - trans::base::trans_crate::hc608c93243bdc3cfn9v
  17:     0x7f026daaead0 - driver::driver::phase_4_translate_to_llvm::ha275ee9ba36f38d9PvS
  18:     0x7f026da9c2f0 - driver::driver::compile_input::h342f6a27db36679d12R
  19:     0x7f026db20280 - driver::run_compiler::h817060b002a7c16090T
  20:     0x7f026db20170 - driver::run::closure.59904
  21:     0x7f026d927d10 - task::TaskBuilder::try_future::closure.39020
  22:     0x7f026d45f010 - task::TaskBuilder::spawn_internal::closure.30320
  23:     0x7f026d0e5100 - task::Task::spawn::closure.5727
  24:     0x7f026d13f470 - rust_try_inner
  25:     0x7f026d13f460 - rust_try
  26:     0x7f026d0e51e0 - unwind::try::h75fe9090402d7736lFc
  27:     0x7f026d0e4fa0 - task::Task::run::h1f2cd4b02103da7aeOb
  28:     0x7f026d0e4b90 - task::Task::spawn::closure.5703
  29:     0x7f026d0e65e0 - thread::thread_start::h60b7b4aa191da867h6b
  30:     0x7f0267e4d0c0 - start_thread
  31:     0x7f026cdabf89 - __clone
  32:                0x0 - <unknown>

@ftxqxd ftxqxd changed the title ICE on implementing a function with an extern "rust-call" function ICE on implementing a trait with an extern "rust-call" function Nov 29, 2014
@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 6, 2015
@nagisa
Copy link
Member

nagisa commented Feb 20, 2015

Can still reproduce. cc me

@tamird
Copy link
Contributor

tamird commented Apr 22, 2015

triage: still ICEs.

#![feature(unboxed_closures)]

trait Foo {
    extern "rust-call" fn foo();
}

impl Foo for () {
    extern "rust-call" fn foo() {}
}

fn main() {}

@steveklabnik
Copy link
Member

Triage: still ICEs

@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed C-bug Category: This is a bug. labels Jul 22, 2017
@chordowl
Copy link
Contributor

Traige: still ICEs

@steveklabnik
Copy link
Member

Triage: this no longer ICEs! 🎊

steveklabnik added a commit to rust-lang/glacier that referenced this issue Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

7 participants