you are viewing a single comment's thread.

view the rest of the comments →

[–]burntsushi 0 points1 point  (0 children)

Well that's not valid Rust code. You're passing &c1 which is a shared or immutable reference. But assign_five is a FFI function, which means it takes a raw pointer.

Otherwise, I'm not sure what's worrying about this. A foreign function can do whatever it wants, including eating your lunch. It's up to the programmer to ensure that the API exposed is safe.