We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I have a compiler error when i'm trying to call a C foreign function.
This is the error :
error: internal compiler error: type_of with ty_param leaked memory in rust main loop (1 objects) rustc: /home/jeremy/Templates/rust-master/rust/src/rt/memory_region.cpp:192: memory_region::~memory_region(): Assertion `false' failed.
And this is the code who produce the error :
mod ffi { pub extern "C" { object_create(function : *u8, data : *c_void) -> *c_Object; } } pub trait TestTrait { pub fn execute(&self); } struct Test; impl Test { pub fn new() -> Test { Test } } impl TestTrait for Test { pub fn execute(&self) -> () { io::println("Hello world"); } } extern fn callback_function<T : TestTrait>(data : &T) -> () { data.execute(); } pub struct ObjectWrapped { priv obj : *ffi::c_Object } impl ObjectWrapped { pub fn new<T : TestTrait>(params : &T) -> ObjectWrapped { let o = unsafe {ffi::object_create(callback_function, cast::transmute::<*T, *c_void>(params))}; ObjectWrapped {obj : o} }
The text was updated successfully, but these errors were encountered:
Presumably related to the generic callback.
Sorry, something went wrong.
Fixed by #10353. (See #12502 for supporting generic foreign functions.)
Thanks @klutzy, closed by 8f3f666
Auto merge of rust-lang#7529 - giraffate:update_node_version, r=flip1…
8556910
…995,llogiq Use node v12.x in CI In rust-lang/rust-clippy#7528 (comment), remark-cli version has been updated recently and it requires to use ESM module: https://github.com/remarkjs/remark/releases/tag/14.0.0. Node version in CI was v10.24.1, it seems to be old. changelog: none
No branches or pull requests
Hi,
I have a compiler error when i'm trying to call a C foreign function.
This is the error :
And this is the code who produce the error :
The text was updated successfully, but these errors were encountered: