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
Allow raw pointers in extern fn signature #164
Comments
Function pointers need to get the same check too. A function pointer type that has a raw pointer argument should be required to be specified as unsafe. extern "Rust" {
fn g(callback: unsafe fn(*mut T));
} |
In contrast to argument position, a pointer in return position should not enforce that the function is unsafe. #283 extern "C++" {
type socc_examples_fixture;
type SDIDevicePropInfoDataset;
fn wait_for_IsEnable(
self: &mut socc_examples_fixture,
code: u16,
expect: u16,
retry_count: i32,
) -> *mut SDIDevicePropInfoDataset;
} |
I am trying to call the following function found in
Given the Is there a workaround I could try? My code currently looks like this:
|
This is likely to be the next thing I look into adding. I haven't started yet. If anyone else thinks they'll do something in this area, please let me know so we can avoid duplication. |
This proved easier than I thought - WIP linked just above. I need to do some thinking about what happens if a raw pointer is included in some other type, e.g. a |
Could the |
See #122 (comment) for the rationale.
The presence of
*const
or*mut
in a function argument should enforce that the function is marked unsafe.The text was updated successfully, but these errors were encountered: