Open
Description
It looks like rust uses pass by value for fixed-size array ([f64;3]
), but C uses pass by reference (pointer to the first element).
Which means a functions like
pub unsafe extern fn with_array(foo: [f64; 3]) {
// code
}
will be translated as
void with_array(double foo[3]);
which is incorrect, as rust will look for 3 values in the parameters, and not a single pointer.
If I correct the rust function to match the C prototype as
pub unsafe extern fn with_array(foo: &[f64; 3])
cbindgen will emit the wrong declaration:
void with_array(double (*foo)[3]);