danielpclark / rutie

“The Tie Between Ruby and Rust.”
MIT License
940 stars 62 forks source link

FFI safe errors on Rust 1.46 #128

Closed calavera closed 3 years ago

calavera commented 4 years ago

Our CI just bumped the Rust toolchain to 1.46 and we started seeing FFI errors. I would expect the safe FFI annotations to be declared by Rutie, so all projects that use this library don't need to change their code, but I don't know if that's possible.

These are the errors:

15 | class!(BundleRemaps);
   | ^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `extern` fn uses type `BundleRemaps`, which is not FFI-safe
  --> mesh-ruby/src/lib.rs:19:5
   |
19 |     BundleRemaps,
   |     ^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
   = note: this struct has unspecified layout
note: the type is defined here