Skip to content

ICE when implementing an extern function for a struct #19138

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

Closed
michaelwu opened this issue Nov 20, 2014 · 1 comment
Closed

ICE when implementing an extern function for a struct #19138

michaelwu opened this issue Nov 20, 2014 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@michaelwu
Copy link
Contributor

This seems to ICE rustc with:

task 'rustc' panicked at 'assertion failed: f.abi == Rust || f.abi == RustCall', /home/mikew/moz/rust/src/librustc/middle/trans/base.rs:2354

stack backtrace:
   1:     0x7fa499f9e9d0 - rt::backtrace::imp::write::h0cab0bbb58bba71escq
   2:     0x7fa499fa1a50 - failure::on_fail::h6ac545c6bf7ea5263xq
   3:     0x7fa49a73c600 - unwind::begin_unwind_inner::he5d38a771f1206897Rd
   4:     0x7fa49ab1a3b0 - unwind::begin_unwind::h1086155491838850086
   5:     0x7fa49af441e0 - middle::trans::base::register_fn::hfd170b590ed3a02fmii
   6:     0x7fa49af46cd0 - middle::trans::base::register_method::hfe10e0da5709cf90LYi
   7:     0x7fa49ae8fe30 - middle::trans::base::get_item_val::h6d62bf177e2d4e6aTGi
   8:     0x7fa49af42540 - middle::trans::meth::trans_impl::hd263ff9d7dcb7badB0m
   9:     0x7fa49ae8eb10 - middle::trans::base::trans_item::h2513dbab928ac05aSai
  10:     0x7fa49af49450 - middle::trans::base::trans_crate::h573d15cff926c8d7T8i
  11:     0x7fa49b39afe0 - driver::driver::phase_4_translate_to_llvm::h61f5ea2b09bc4eebAyC
  12:     0x7fa49b391e80 - driver::driver::compile_input::h20774442580da6c5u5B
  13:     0x7fa49b415230 - driver::run_compiler::h32117b7363daaea3LVF
  14:     0x7fa49b415120 - driver::run::closure.146540
  15:     0x7fa49ab4f4a0 - task::TaskBuilder<S>::try_future::closure.104852
  16:     0x7fa49ab4f290 - task::TaskBuilder<S>::spawn_internal::closure.104823
  17:     0x7fa49bc9f160 - task::NativeSpawner.Spawner::spawn::closure.8456
  18:     0x7fa49a791650 - rust_try_inner
  19:     0x7fa49a791640 - rust_try
  20:     0x7fa49a739f80 - unwind::try::h3154e4b14627d719PGd
  21:     0x7fa49a739e10 - task::Task::run::h554324f28003d18dFMc
  22:     0x7fa49bc9eea0 - task::NativeSpawner.Spawner::spawn::closure.8394
  23:     0x7fa49a73b620 - thread::thread_start::h4297c8c4ec78b606U7c
  24:     0x7fa499a6cd40 - start_thread
  25:     0x7fa49a40c299 - clone
  26:                0x0 - <unknown>

Testcase:

struct Foo {
        Bar: i32,
}

impl Foo {
        extern fn X() -> i32 {
                0
        }
}

fn main() {
}
@huonw huonw added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 20, 2014
@huonw
Copy link
Member

huonw commented Nov 20, 2014

Dupe of #19047; thanks for filing!

@huonw huonw closed this as completed Nov 20, 2014
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

2 participants