-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-codegenArea: Code generationArea: Code generationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
I'm trying de do a binding for a c library and i get an error when i try to pass a struct of float to a C foreign function. This is the error given by rustc :
rust: task failed at 'index out of bounds: the len is 2 but the index is 2', /rust_install/rust-0.6/src/librustc/middle/trans/cabi_x86_64.rs:248
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /rust_install/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x13863c0 root task failed
And this is the code who produce the error
#[link(name = "my_lib",
vers = "0.1")];
#[crate_type = "lib"];
use core::libc::{c_void};
pub extern "C" {
fn rect_create() -> *rect;
fn set_point(rect : *rect, pos : Vector2f) -> ();
}
pub struct rect {
This : *c_void
}
pub struct Vector2f {
x : f32,
y : f32
}
pub struct RectWrapped {
priv rect : *rect
}
impl RectWrapped {
pub fn new() -> RectWrapped {
RectWrapped {rect : unsafe {rect_create()}}
}
}Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️