Skip to content
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

#[ffi_export] doesn't work with mut keyword in parameters #110

Closed
TheButlah opened this issue May 19, 2022 · 1 comment · Fixed by #111
Closed

#[ffi_export] doesn't work with mut keyword in parameters #110

TheButlah opened this issue May 19, 2022 · 1 comment · Fixed by #111
Labels
K-bug Kind: existing code isn’t behaving as expected

Comments

@TheButlah
Copy link
Contributor

This code:

#[ffi_export]
pub fn f(mut v: repr_c::Vec<u8>) {
    // let mut v = v;
    v.with_rust_mut(|v| *v = Vec::new());
}

Fails with this error:
image

This error goes away when uncommenting the line and removing mut from the parameter

@TheButlah TheButlah changed the title #[ffi_export] doesn't work with mut keyword in parameters #[ffi_export] doesn't work with mut keyword in parameters May 19, 2022
@danielhenrymantilla danielhenrymantilla added the K-bug Kind: existing code isn’t behaving as expected label May 20, 2022
@danielhenrymantilla
Copy link
Collaborator

Fixed as of https://crates.io/crates/safer-ffi/0.0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K-bug Kind: existing code isn’t behaving as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants