Skip to content

'rustc' panicked at 'assertion failed: f.abi == Rust || f.abi == RustCall' #19047

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
abhijeetbhagat opened this issue Nov 17, 2014 · 3 comments
Closed
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@abhijeetbhagat
Copy link
Contributor

I am doing FFI and this is what i wrote:

pub struct Cursor{
    conn : Connection,
    stmt : *mut sqlite3_stmt,
    pzTail :*const c_char
}
impl Cursor{
 extern fn foo(){}
}

Error:

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 'assertion failed: f.abi == Rust || f.abi == RustCall', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustc/middle/trans/base.rs:2354
$ rustc --version=verbose
rustc 0.13.0-nightly
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 0.13.0-nightly
@nodakai
Copy link
Contributor

nodakai commented Nov 18, 2014

Minimized down to

struct S;

impl S {
    extern fn f() { }
}

fn main() {
}

Interesting... The panic message seems to say that the "C" ABI (extern defaluts to "C") should have been rejected at an earlier stage of compilation.

Btw, my understanding is that all you can export by Rust FFI are limited to C function calls. I don't think you can export OOP-style method calls such as obj.method() to C++.

@nodakai
Copy link
Contributor

nodakai commented Nov 20, 2014

#19138 is the same.

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

Just tried compiling @nodakai's minimized code above and can confirm that this is still resulting in an ICE.

~ $ rustc -Vv
rustc 1.0.0-nightly (b9ba643b7 2015-02-13 21:15:39 +0000)
binary: rustc
commit-hash: b9ba643b72ea6104bcb1209d238f6b445e3b51fc
commit-date: 2015-02-13 21:15:39 +0000
host: x86_64-apple-darwin
release: 1.0.0-nightly

lnicola added a commit to lnicola/rust that referenced this issue Feb 10, 2025
fix: Fix syntactic highlighting for renames
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