Set needs_indirect_abi for Array

Otherwise:

    warning: `extern` fn uses type `[u8; 3]`, which is not FFI-safe
     --> src/main.rs:8:21
      |
    8 |         fn arr() -> [u8; 3];
      |                     ^^^^^^^ not FFI-safe
      |
      = note: `#[warn(improper_ctypes_definitions)]` on by default
      = help: consider passing a pointer to the array
      = note: passing raw arrays by value is not FFI-safe
This commit is contained in:
David Tolnay 2020-11-24 20:32:45 -08:00
parent 8f8d78dded
commit 2cabd0a8a3
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -254,7 +254,7 @@ impl<'a> Types<'a> {
Atom::from(&ident.rust) == Some(RustString)
}
}
Type::RustVec(_) => true,
Type::RustVec(_) | Type::Array(_) => true,
_ => false,
}
}