-
Notifications
You must be signed in to change notification settings - Fork 43
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
mismatched types between c_void
and boxed closure
#59
Comments
Oh, this is still not working. I got |
No, you can't. You should use |
Not working, it doesn't typecheck :(
Or if I first box it then |
Please refer to this one: https://github.com/zonyitoo/context-rs/blob/master/examples/asymmetric.rs They should be almost the same. I am extremely busy these days so I am not going to fix this lately. |
When compiled with nightly
rustc
, this line will report error:I searched a bit and find a solution from this post: change
Box::new(wrapper)
into&wrapper as *const _ as *mut libc::c_void
It compiled. But honestly, I am not very familiar with low-level rust so I have no idea why the
Box::new
is wrong and this casting is right.The text was updated successfully, but these errors were encountered: